From f13e7706ed2f8baad6d5d2c3cf941a6f7984ccba Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 5 Sep 2023 11:54:53 +0200 Subject: [PATCH] Use shorthand attributes in Nuheat (#99618) --- homeassistant/components/nuheat/climate.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/nuheat/climate.py b/homeassistant/components/nuheat/climate.py index 18b34ea0bea..4daaee10ea6 100644 --- a/homeassistant/components/nuheat/climate.py +++ b/homeassistant/components/nuheat/climate.py @@ -77,6 +77,7 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity): ) _attr_has_entity_name = True _attr_name = None + _attr_preset_modes = PRESET_MODES def __init__(self, coordinator, thermostat, temperature_unit): """Initialize the thermostat.""" @@ -85,6 +86,7 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity): self._temperature_unit = temperature_unit self._schedule_mode = None self._target_temperature = None + self._attr_unique_id = thermostat.serial_number @property def temperature_unit(self) -> str: @@ -102,11 +104,6 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity): return self._thermostat.fahrenheit - @property - def unique_id(self): - """Return the unique id.""" - return self._thermostat.serial_number - @property def available(self) -> bool: """Return the unique id.""" @@ -160,11 +157,6 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity): """Return current preset mode.""" return SCHEDULE_MODE_TO_PRESET_MODE_MAP.get(self._schedule_mode, PRESET_RUN) - @property - def preset_modes(self): - """Return available preset modes.""" - return PRESET_MODES - def set_preset_mode(self, preset_mode: str) -> None: """Update the hold mode of the thermostat.""" self._set_schedule_mode(