1 """Binary sensor platform for integration_blueprint."""
5 from pydeako
import Deako
12 from .
import DeakoConfigEntry
13 from .const
import DOMAIN
17 MODEL_DIMMER =
"dimmer"
22 config: DeakoConfigEntry,
23 add_entities: AddEntitiesCallback,
25 """Configure the platform."""
26 client = config.runtime_data
32 """Deako LightEntity class."""
34 _attr_has_entity_name =
True
37 _attr_available =
True
41 def __init__(self, client: Deako, uuid: str) ->
None:
42 """Save connection reference."""
46 dimmable = client.is_dimmable(uuid)
57 identifiers={(DOMAIN, uuid)},
58 name=client.get_name(uuid),
63 client.set_state_callback(uuid, self.
on_updateon_update)
67 """State update callback."""
72 """Control entity state via client."""
77 """Turn on the light."""
79 if ATTR_BRIGHTNESS
in kwargs:
80 dim = round(kwargs[ATTR_BRIGHTNESS] / 2.55, 0)
84 """Turn off the device."""
88 """Call to update state."""
None control_device(self, bool power, int|None dim=None)
_attr_supported_color_modes
None async_turn_off(self, **Any kwargs)
None __init__(self, Deako client, str uuid)
None async_turn_on(self, **Any kwargs)
None schedule_update_ha_state(self, bool force_refresh=False)
None add_entities(AsusWrtRouter router, AddEntitiesCallback async_add_entities, set[str] tracked)
None async_setup_entry(HomeAssistant hass, DeakoConfigEntry config, AddEntitiesCallback add_entities)
str|float get_state(dict[str, float] data, str key)