From a78f183b640b7f59ece8429c95aae21bd3120b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 17 May 2022 21:47:28 +0200 Subject: [PATCH] Fix Airzone sensor and binary sensor updates (#72025) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit airzone: fix sensor and binary sensor updates This regression was introduced in b9b83c05e9d53963891bb50ec9ed14c2bb07f4b5 along with the modifications for the strict typing. Signed-off-by: Álvaro Fernández Rojas --- homeassistant/components/airzone/binary_sensor.py | 6 ++++++ homeassistant/components/airzone/sensor.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/homeassistant/components/airzone/binary_sensor.py b/homeassistant/components/airzone/binary_sensor.py index d1885e0edf9..7ad3254c080 100644 --- a/homeassistant/components/airzone/binary_sensor.py +++ b/homeassistant/components/airzone/binary_sensor.py @@ -119,6 +119,12 @@ class AirzoneBinarySensor(AirzoneEntity, BinarySensorEntity): entity_description: AirzoneBinarySensorEntityDescription + @callback + def _handle_coordinator_update(self) -> None: + """Update attributes when the coordinator updates.""" + self._async_update_attrs() + super()._handle_coordinator_update() + @callback def _async_update_attrs(self) -> None: """Update binary sensor attributes.""" diff --git a/homeassistant/components/airzone/sensor.py b/homeassistant/components/airzone/sensor.py index 1671eb919a7..86d88aa5a55 100644 --- a/homeassistant/components/airzone/sensor.py +++ b/homeassistant/components/airzone/sensor.py @@ -102,6 +102,12 @@ async def async_setup_entry( class AirzoneSensor(AirzoneEntity, SensorEntity): """Define an Airzone sensor.""" + @callback + def _handle_coordinator_update(self) -> None: + """Update attributes when the coordinator updates.""" + self._async_update_attrs() + super()._handle_coordinator_update() + @callback def _async_update_attrs(self) -> None: """Update sensor attributes."""