mirror of
https://github.com/home-assistant/core
synced 2024-08-28 03:36:46 +02:00
Use shorthand attr for screenlogic climate preset modes (#106858)
This commit is contained in:
parent
bbdccede85
commit
73bc65059b
@ -94,6 +94,9 @@ class ScreenLogicClimate(ScreenLogicPushEntity, ClimateEntity, RestoreEntity):
|
|||||||
[HEAT_MODE.SOLAR, HEAT_MODE.SOLAR_PREFERRED]
|
[HEAT_MODE.SOLAR, HEAT_MODE.SOLAR_PREFERRED]
|
||||||
)
|
)
|
||||||
self._configured_heat_modes.append(HEAT_MODE.HEATER)
|
self._configured_heat_modes.append(HEAT_MODE.HEATER)
|
||||||
|
self._attr_preset_modes = [
|
||||||
|
HEAT_MODE(mode_num).title for mode_num in self._configured_heat_modes
|
||||||
|
]
|
||||||
|
|
||||||
self._attr_min_temp = self.entity_data[ATTR.MIN_SETPOINT]
|
self._attr_min_temp = self.entity_data[ATTR.MIN_SETPOINT]
|
||||||
self._attr_max_temp = self.entity_data[ATTR.MAX_SETPOINT]
|
self._attr_max_temp = self.entity_data[ATTR.MAX_SETPOINT]
|
||||||
@ -140,11 +143,6 @@ class ScreenLogicClimate(ScreenLogicPushEntity, ClimateEntity, RestoreEntity):
|
|||||||
return HEAT_MODE(self._last_preset).title
|
return HEAT_MODE(self._last_preset).title
|
||||||
return HEAT_MODE(self.entity_data[VALUE.HEAT_MODE][ATTR.VALUE]).title
|
return HEAT_MODE(self.entity_data[VALUE.HEAT_MODE][ATTR.VALUE]).title
|
||||||
|
|
||||||
@property
|
|
||||||
def preset_modes(self) -> list[str]:
|
|
||||||
"""All available presets."""
|
|
||||||
return [HEAT_MODE(mode_num).title for mode_num in self._configured_heat_modes]
|
|
||||||
|
|
||||||
async def async_set_temperature(self, **kwargs: Any) -> None:
|
async def async_set_temperature(self, **kwargs: Any) -> None:
|
||||||
"""Change the setpoint of the heater."""
|
"""Change the setpoint of the heater."""
|
||||||
if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
|
if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user