mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 10:17:51 +00:00
Use shorthand attributes in Nuheat (#99618)
This commit is contained in:
parent
2c3a4b3497
commit
f13e7706ed
@ -77,6 +77,7 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity):
|
|||||||
)
|
)
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
_attr_name = None
|
_attr_name = None
|
||||||
|
_attr_preset_modes = PRESET_MODES
|
||||||
|
|
||||||
def __init__(self, coordinator, thermostat, temperature_unit):
|
def __init__(self, coordinator, thermostat, temperature_unit):
|
||||||
"""Initialize the thermostat."""
|
"""Initialize the thermostat."""
|
||||||
@ -85,6 +86,7 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity):
|
|||||||
self._temperature_unit = temperature_unit
|
self._temperature_unit = temperature_unit
|
||||||
self._schedule_mode = None
|
self._schedule_mode = None
|
||||||
self._target_temperature = None
|
self._target_temperature = None
|
||||||
|
self._attr_unique_id = thermostat.serial_number
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def temperature_unit(self) -> str:
|
def temperature_unit(self) -> str:
|
||||||
@ -102,11 +104,6 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity):
|
|||||||
|
|
||||||
return self._thermostat.fahrenheit
|
return self._thermostat.fahrenheit
|
||||||
|
|
||||||
@property
|
|
||||||
def unique_id(self):
|
|
||||||
"""Return the unique id."""
|
|
||||||
return self._thermostat.serial_number
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return the unique id."""
|
"""Return the unique id."""
|
||||||
@ -160,11 +157,6 @@ class NuHeatThermostat(CoordinatorEntity, ClimateEntity):
|
|||||||
"""Return current preset mode."""
|
"""Return current preset mode."""
|
||||||
return SCHEDULE_MODE_TO_PRESET_MODE_MAP.get(self._schedule_mode, PRESET_RUN)
|
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:
|
def set_preset_mode(self, preset_mode: str) -> None:
|
||||||
"""Update the hold mode of the thermostat."""
|
"""Update the hold mode of the thermostat."""
|
||||||
self._set_schedule_mode(
|
self._set_schedule_mode(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user