From 5f3e70f9154cfa9a4273a2cd7e791fdb667a7bcb Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:25:04 +0200 Subject: [PATCH] Fix climate entity in ViCare integration (#127128) do not reset _attributes --- homeassistant/components/vicare/climate.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/vicare/climate.py b/homeassistant/components/vicare/climate.py index b742ad257fa..8a116038533 100644 --- a/homeassistant/components/vicare/climate.py +++ b/homeassistant/components/vicare/climate.py @@ -167,7 +167,9 @@ class ViCareClimate(ViCareEntity, ClimateEntity): try: _room_temperature = None with suppress(PyViCareNotSupportedFeatureError): - _room_temperature = self._api.getRoomTemperature() + self._attributes["room_temperature"] = _room_temperature = ( + self._api.getRoomTemperature() + ) _supply_temperature = None with suppress(PyViCareNotSupportedFeatureError): @@ -181,20 +183,17 @@ class ViCareClimate(ViCareEntity, ClimateEntity): self._attr_current_temperature = None with suppress(PyViCareNotSupportedFeatureError): - self._current_program = self._api.getActiveProgram() + self._attributes["active_vicare_program"] = self._current_program = ( + self._api.getActiveProgram() + ) with suppress(PyViCareNotSupportedFeatureError): self._attr_target_temperature = self._api.getCurrentDesiredTemperature() with suppress(PyViCareNotSupportedFeatureError): - self._current_mode = self._api.getActiveMode() - - # Update the generic device attributes - self._attributes = { - "room_temperature": _room_temperature, - "active_vicare_program": self._current_program, - "active_vicare_mode": self._current_mode, - } + self._attributes["active_vicare_mode"] = self._current_mode = ( + self._api.getActiveMode() + ) with suppress(PyViCareNotSupportedFeatureError): self._attributes["heating_curve_slope"] = (