From 471878b5faa22733223e7c88cb57d38b5a2f5480 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 31 Aug 2022 22:05:31 +0200 Subject: [PATCH] Adjust temperature_unit in hisense_aehw4a1 (#77585) --- .../components/hisense_aehw4a1/climate.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/hisense_aehw4a1/climate.py b/homeassistant/components/hisense_aehw4a1/climate.py index 9612fd74f0b..a5d8dc800af 100644 --- a/homeassistant/components/hisense_aehw4a1/climate.py +++ b/homeassistant/components/hisense_aehw4a1/climate.py @@ -160,7 +160,6 @@ class ClimateAehW4a1(ClimateEntity): self._preset_modes = PRESET_MODES self._available = None self._on = None - self._temperature_unit = None self._current_temperature = None self._target_temperature = None self._attr_hvac_mode = None @@ -185,9 +184,9 @@ class ClimateAehW4a1(ClimateEntity): self._on = status["run_status"] if status["temperature_Fahrenheit"] == "0": - self._temperature_unit = TEMP_CELSIUS + self._attr_temperature_unit = TEMP_CELSIUS else: - self._temperature_unit = TEMP_FAHRENHEIT + self._attr_temperature_unit = TEMP_FAHRENHEIT self._current_temperature = int(status["indoor_temperature_status"], 2) @@ -237,11 +236,6 @@ class ClimateAehW4a1(ClimateEntity): """Return the name of the climate device.""" return self._unique_id - @property - def temperature_unit(self): - """Return the unit of measurement.""" - return self._temperature_unit - @property def current_temperature(self): """Return the current temperature.""" @@ -285,14 +279,14 @@ class ClimateAehW4a1(ClimateEntity): @property def min_temp(self): """Return the minimum temperature.""" - if self._temperature_unit == TEMP_CELSIUS: + if self.temperature_unit == TEMP_CELSIUS: return MIN_TEMP_C return MIN_TEMP_F @property def max_temp(self): """Return the maximum temperature.""" - if self._temperature_unit == TEMP_CELSIUS: + if self.temperature_unit == TEMP_CELSIUS: return MAX_TEMP_C return MAX_TEMP_F @@ -312,7 +306,7 @@ class ClimateAehW4a1(ClimateEntity): _LOGGER.debug("Setting temp of %s to %s", self._unique_id, temp) if self._preset_mode != PRESET_NONE: await self.async_set_preset_mode(PRESET_NONE) - if self._temperature_unit == TEMP_CELSIUS: + if self.temperature_unit == TEMP_CELSIUS: await self._device.command(f"temp_{int(temp)}_C") else: await self._device.command(f"temp_{int(temp)}_F")