1 """Support for Daikin AirBase zones."""
3 from __future__
import annotations
13 from .coordinator
import DaikinCoordinator
14 from .entity
import DaikinEntity
16 DAIKIN_ATTR_ADVANCED =
"adv"
17 DAIKIN_ATTR_STREAMER =
"streamer"
18 DAIKIN_ATTR_MODE =
"mode"
22 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
24 """Set up Daikin climate based on config_entry."""
25 daikin_api: DaikinCoordinator = hass.data[DOMAIN][entry.entry_id]
26 switches: list[SwitchEntity] = []
27 if zones := daikin_api.device.zones:
30 for zone_id, zone
in enumerate(zones)
33 if daikin_api.device.support_advanced_modes:
43 """Representation of a zone."""
45 _attr_translation_key =
"zone"
47 def __init__(self, coordinator: DaikinCoordinator, zone_id: int) ->
None:
48 """Initialize the zone."""
55 """Return the name of the sensor."""
60 """Return the state of the sensor."""
64 """Turn the zone on."""
69 """Turn the zone off."""
77 _attr_name =
"Streamer"
78 _attr_translation_key =
"streamer"
80 def __init__(self, coordinator: DaikinCoordinator) ->
None:
81 """Initialize switch."""
87 """Return the state of the sensor."""
88 return DAIKIN_ATTR_STREAMER
in self.
devicedevicedevice.represent(DAIKIN_ATTR_ADVANCED)[1]
91 """Turn the zone on."""
96 """Turn the zone off."""
104 _attr_translation_key =
"toggle"
106 def __init__(self, coordinator: DaikinCoordinator) ->
None:
107 """Initialize switch."""
113 """Return the state of the sensor."""
114 return "off" not in self.
devicedevicedevice.represent(DAIKIN_ATTR_MODE)
117 """Turn the zone on."""
122 """Turn the zone off."""
123 await self.
devicedevicedevice.set({DAIKIN_ATTR_MODE:
"off"})
None async_turn_on(self, **Any kwargs)
None __init__(self, DaikinCoordinator coordinator)
None async_turn_off(self, **Any kwargs)
None async_turn_off(self, **Any kwargs)
None async_turn_on(self, **Any kwargs)
None __init__(self, DaikinCoordinator coordinator)
None async_turn_off(self, **Any kwargs)
None __init__(self, DaikinCoordinator coordinator, int zone_id)
None async_turn_on(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)