Add support for HVAC mode "OFF" in Somfy Heating Temperature Interface in Overkiz (#143396)

Co-authored-by: Josef Zweck <josef@zweck.dev>
This commit is contained in:
Mick Vleeshouwer 2025-04-21 21:31:44 +02:00 committed by GitHub
parent f0cf620854
commit 54050f10b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ class SomfyHeatingTemperatureInterface(OverkizEntity, ClimateEntity):
| ClimateEntityFeature.TURN_OFF | ClimateEntityFeature.TURN_OFF
| ClimateEntityFeature.TURN_ON | ClimateEntityFeature.TURN_ON
) )
_attr_hvac_modes = [*HVAC_MODES_TO_OVERKIZ] _attr_hvac_modes = [*HVAC_MODES_TO_OVERKIZ, HVACMode.OFF]
_attr_preset_modes = [*PRESET_MODES_TO_OVERKIZ] _attr_preset_modes = [*PRESET_MODES_TO_OVERKIZ]
# Both min and max temp values have been retrieved from the Somfy Application. # Both min and max temp values have been retrieved from the Somfy Application.
_attr_min_temp = 15.0 _attr_min_temp = 15.0
@ -110,9 +110,14 @@ class SomfyHeatingTemperatureInterface(OverkizEntity, ClimateEntity):
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set new target hvac mode.""" """Set new target hvac mode."""
await self.executor.async_execute_command( if hvac_mode is HVACMode.OFF:
OverkizCommand.SET_ACTIVE_MODE, HVAC_MODES_TO_OVERKIZ[hvac_mode] await self.executor.async_execute_command(
) OverkizCommand.SET_ON_OFF, OverkizCommandParam.OFF
)
else:
await self.executor.async_execute_command(
OverkizCommand.SET_ACTIVE_MODE, HVAC_MODES_TO_OVERKIZ[hvac_mode]
)
@property @property
def preset_mode(self) -> str | None: def preset_mode(self) -> str | None: