1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Move condition to prioritize preset mode (eco/comfort...) instead of program name in Overkiz (#160189)

This commit is contained in:
Simon Delberghe
2026-01-10 23:58:19 +01:00
committed by GitHub
parent ce234d69a7
commit b4360ccbd9

View File

@@ -128,15 +128,15 @@ class AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint(
states = self.device.states
if (
operating_mode := states[OverkizState.CORE_OPERATING_MODE]
) and operating_mode.value_as_str == OverkizCommandParam.EXTERNAL:
return PRESET_EXTERNAL
if (
state := states[OverkizState.IO_TARGET_HEATING_LEVEL]
) and state.value_as_str:
return OVERKIZ_TO_PRESET_MODE[state.value_as_str]
if (
operating_mode := states[OverkizState.CORE_OPERATING_MODE]
) and operating_mode.value_as_str == OverkizCommandParam.EXTERNAL:
return PRESET_EXTERNAL
return None
async def async_set_preset_mode(self, preset_mode: str) -> None: