1 """The WiLight integration."""
5 from pywilight.wilight_device
import PyWiLightDevice
11 from .const
import DOMAIN
15 """Representation of a WiLight device.
17 Contains the common logic for WiLight entities.
20 _attr_should_poll =
False
21 _attr_has_entity_name =
True
23 def __init__(self, api_device: PyWiLightDevice, index: str, item_name: str) ->
None:
24 """Initialize the device."""
29 self.
_status_status: dict[str, Any] = {}
35 model=api_device.model,
36 manufacturer=
"WiLight",
37 sw_version=api_device.swversion,
38 via_device=(DOMAIN, self.
_device_id_device_id),
43 """Return True if entity is available."""
48 """Propagate changes through ha."""
53 """Synchronize state with api_device."""
57 """Register update callback."""
None __init__(self, PyWiLightDevice api_device, str index, str item_name)
None async_added_to_hass(self)
None handle_event_callback(self, dict[str, Any] states)
None async_write_ha_state(self)