mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Ensure EcoNet operation modes are unique (#141689)
This commit is contained in:
parent
35fc81b038
commit
85ad29e28e
@ -91,15 +91,15 @@ class EcoNetWaterHeater(EcoNetEntity[WaterHeater], WaterHeaterEntity):
|
|||||||
def operation_list(self) -> list[str]:
|
def operation_list(self) -> list[str]:
|
||||||
"""List of available operation modes."""
|
"""List of available operation modes."""
|
||||||
econet_modes = self.water_heater.modes
|
econet_modes = self.water_heater.modes
|
||||||
op_list = []
|
operation_modes = set()
|
||||||
for mode in econet_modes:
|
for mode in econet_modes:
|
||||||
if (
|
if (
|
||||||
mode is not WaterHeaterOperationMode.UNKNOWN
|
mode is not WaterHeaterOperationMode.UNKNOWN
|
||||||
and mode is not WaterHeaterOperationMode.VACATION
|
and mode is not WaterHeaterOperationMode.VACATION
|
||||||
):
|
):
|
||||||
ha_mode = ECONET_STATE_TO_HA[mode]
|
ha_mode = ECONET_STATE_TO_HA[mode]
|
||||||
op_list.append(ha_mode)
|
operation_modes.add(ha_mode)
|
||||||
return op_list
|
return list(operation_modes)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> WaterHeaterEntityFeature:
|
def supported_features(self) -> WaterHeaterEntityFeature:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user