1 """Demo platform that offers a fake event entity."""
3 from __future__
import annotations
16 config_entry: ConfigEntry,
17 async_add_entities: AddEntitiesCallback,
19 """Set up the demo event platform."""
24 """Representation of a demo event entity."""
26 _attr_device_class = EventDeviceClass.BUTTON
27 _attr_event_types = [
"pressed"]
28 _attr_has_entity_name =
True
29 _attr_name =
"Button press"
30 _attr_should_poll =
False
31 _attr_translation_key =
"push"
32 _attr_unique_id =
"push"
35 """Initialize the Demo event entity."""
37 identifiers={(DOMAIN,
"push")},
41 """Register callbacks."""
46 """Handle the demo button event."""
None _async_handle_event(self, Event _)
None async_added_to_hass(self)
None _trigger_event(self, str event_type, dict[str, Any]|None event_attributes=None)
None async_write_ha_state(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)