1 """Support for Nanoleaf event entity."""
8 from .
import NanoleafConfigEntry, NanoleafCoordinator
9 from .const
import TOUCH_MODELS
10 from .entity
import NanoleafEntity
15 entry: NanoleafConfigEntry,
16 async_add_entities: AddEntitiesCallback,
18 """Set up the Nanoleaf event."""
19 coordinator = entry.runtime_data
20 if coordinator.nanoleaf.model
in TOUCH_MODELS:
25 """Representation of a Nanoleaf event entity."""
33 _attr_translation_key =
"touch"
35 def __init__(self, coordinator: NanoleafCoordinator) ->
None:
36 """Initialize the Nanoleaf event entity."""
41 """Subscribe to Nanoleaf events."""
46 f
"nanoleaf_gesture_{self._nanoleaf.serial_no}",
53 """Handle the event."""
None _trigger_event(self, str event_type, dict[str, Any]|None event_attributes=None)
None __init__(self, NanoleafCoordinator coordinator)
None _async_handle_event(self, str gesture)
None async_added_to_hass(self)
None async_write_ha_state(self)
None async_on_remove(self, CALLBACK_TYPE func)
None async_setup_entry(HomeAssistant hass, NanoleafConfigEntry entry, AddEntitiesCallback async_add_entities)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)