1 """Select sensor entities for LIFX integration."""
3 from __future__
import annotations
5 from aiolifx_themes.themes
import ThemeLibrary
17 INFRARED_BRIGHTNESS_VALUES_MAP,
19 from .coordinator
import LIFXUpdateCoordinator
20 from .entity
import LIFXEntity
21 from .util
import lifx_features
23 THEME_NAMES = [theme_name.lower()
for theme_name
in ThemeLibrary().themes]
26 key=INFRARED_BRIGHTNESS,
27 translation_key=
"infrared_brightness",
28 entity_category=EntityCategory.CONFIG,
29 options=
list(INFRARED_BRIGHTNESS_VALUES_MAP.values()),
34 translation_key=
"theme",
35 entity_category=EntityCategory.CONFIG,
41 hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
43 """Set up LIFX from a config entry."""
44 coordinator: LIFXUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
46 entities: list[LIFXEntity] = []
63 """LIFX Nightvision infrared brightness configuration entity."""
67 coordinator: LIFXUpdateCoordinator,
68 description: SelectEntityDescription,
70 """Initialise the IR brightness config entity."""
73 self.
_attr_unique_id_attr_unique_id = f
"{coordinator.serial_number}_{description.key}"
78 """Handle updated data from the coordinator."""
84 """Handle coordinator updates."""
88 """Update the infrared brightness value."""
93 """Theme entity for LIFX multizone devices."""
97 coordinator: LIFXUpdateCoordinator,
98 description: SelectEntityDescription,
100 """Initialise the theme selection entity."""
104 self.
_attr_unique_id_attr_unique_id = f
"{coordinator.serial_number}_{description.key}"
109 """Handle updated data from the coordinator."""
115 """Update attrs from coordinator data."""
119 """Paint the selected theme onto the device."""
None async_apply_theme(self, str theme_name)
None async_set_infrared_brightness(self, str option)
None __init__(self, LIFXUpdateCoordinator coordinator, SelectEntityDescription description)
None _handle_coordinator_update(self)
None async_select_option(self, str option)
None _async_update_attrs(self)
None __init__(self, LIFXUpdateCoordinator coordinator, SelectEntityDescription description)
None _handle_coordinator_update(self)
None async_select_option(self, str option)
None _async_update_attrs(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
dict[str, Any] lifx_features(Light bulb)