1 """Support for Vera scenes."""
3 from __future__
import annotations
7 import pyvera
as veraApi
15 from .common
import ControllerData, get_controller_data
16 from .const
import VERA_ID_FORMAT
22 async_add_entities: AddEntitiesCallback,
24 """Set up the sensor config entry."""
27 [
VeraScene(device, controller_data)
for device
in controller_data.scenes],
True
32 """Representation of a Vera scene entity."""
35 self, vera_scene: veraApi.VeraScene, controller_data: ControllerData
37 """Initialize the scene."""
43 self.
vera_idvera_id = VERA_ID_FORMAT.format(
44 slugify(vera_scene.name), vera_scene.scene_id
48 """Update the scene status."""
52 """Activate the scene."""
57 """Return the state attributes of the scene."""
58 return {
"vera_scene_id": self.
vera_scenevera_scene.vera_scene_id}
dict[str, Any]|None extra_state_attributes(self)
None activate(self, **Any kwargs)
None __init__(self, veraApi.VeraScene vera_scene, ControllerData controller_data)
ControllerData get_controller_data(HomeAssistant hass, ConfigEntry config_entry)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)