mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +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_SMART_SCHEDULE],
|
||||
]
|
||||
supported_fan_modes = None
|
||||
supported_swing_modes = None
|
||||
supported_fan_modes: list[str] | None = None
|
||||
supported_swing_modes: list[str] | None = None
|
||||
heat_temperatures = None
|
||||
cool_temperatures = None
|
||||
|
||||
|
@ -53,13 +53,13 @@ def decide_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."""
|
||||
|
||||
supported_fanmodes = [
|
||||
tado_to_ha_mapping.get(option)
|
||||
for option in options
|
||||
if tado_to_ha_mapping.get(option) is not None
|
||||
val for option in options if (val := tado_to_ha_mapping.get(option)) is not None
|
||||
]
|
||||
if not supported_fanmodes:
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user