From 9b29bb4d218406a5a82ad506c24b423d9710f9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Eld=C3=A9n?= Date: Sun, 15 Sep 2024 18:05:30 +0200 Subject: [PATCH] Update powercanary_sensor.py --- custom_components/peaqev/sensors/power/powercanary_sensor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/peaqev/sensors/power/powercanary_sensor.py b/custom_components/peaqev/sensors/power/powercanary_sensor.py index 4a34f6c3..488cbd93 100644 --- a/custom_components/peaqev/sensors/power/powercanary_sensor.py +++ b/custom_components/peaqev/sensors/power/powercanary_sensor.py @@ -54,7 +54,9 @@ def state(self) -> int: async def async_update(self) -> None: if self.hub.is_initialized: - self._state = self.hub.power.power_canary.state_string # todo: composition + ret = self.hub.power.power_canary.state_string # todo: composition + if ret != self._state: + self._state = ret class PowerCanaryPercentageSensor(PowerCanaryDevice):