mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Improve tado typing (#140505)
This commit is contained in:
parent
c92ee120b6
commit
473a5559cc
@ -157,8 +157,8 @@ async def create_climate_entity(
|
|||||||
TADO_TO_HA_HVAC_MODE_MAP[CONST_MODE_OFF],
|
TADO_TO_HA_HVAC_MODE_MAP[CONST_MODE_OFF],
|
||||||
TADO_TO_HA_HVAC_MODE_MAP[CONST_MODE_SMART_SCHEDULE],
|
TADO_TO_HA_HVAC_MODE_MAP[CONST_MODE_SMART_SCHEDULE],
|
||||||
]
|
]
|
||||||
supported_fan_modes = None
|
supported_fan_modes: list[str] | None = None
|
||||||
supported_swing_modes = None
|
supported_swing_modes: list[str] | None = None
|
||||||
heat_temperatures = None
|
heat_temperatures = None
|
||||||
cool_temperatures = None
|
cool_temperatures = None
|
||||||
|
|
||||||
|
@ -53,13 +53,13 @@ def decide_duration(
|
|||||||
return duration
|
return duration
|
||||||
|
|
||||||
|
|
||||||
def generate_supported_fanmodes(tado_to_ha_mapping: dict[str, str], options: list[str]):
|
def generate_supported_fanmodes(
|
||||||
|
tado_to_ha_mapping: dict[str, str], options: list[str]
|
||||||
|
) -> list[str] | None:
|
||||||
"""Return correct list of fan modes or None."""
|
"""Return correct list of fan modes or None."""
|
||||||
|
|
||||||
supported_fanmodes = [
|
supported_fanmodes = [
|
||||||
tado_to_ha_mapping.get(option)
|
val for option in options if (val := tado_to_ha_mapping.get(option)) is not None
|
||||||
for option in options
|
|
||||||
if tado_to_ha_mapping.get(option) is not None
|
|
||||||
]
|
]
|
||||||
if not supported_fanmodes:
|
if not supported_fanmodes:
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user