1 """Support for scenes provided by WMS WebControl pro."""
3 from __future__
import annotations
7 from wmspro.scene
import Scene
as WMS_Scene
14 from .
import WebControlProConfigEntry
15 from .const
import ATTRIBUTION, DOMAIN, MANUFACTURER
20 config_entry: WebControlProConfigEntry,
21 async_add_entities: AddEntitiesCallback,
23 """Set up the WMS based scenes from a config entry."""
24 hub = config_entry.runtime_data
28 for scene
in hub.scenes.values()
33 """Representation of a WMS based scene."""
35 _attr_attribution = ATTRIBUTION
36 _attr_has_entity_name =
True
38 def __init__(self, config_entry_id: str, scene: WMS_Scene) ->
None:
39 """Initialize the entity with the configured scene."""
50 room_id_str =
str(room.id)
52 identifiers={(DOMAIN, room_id_str)},
53 manufacturer=MANUFACTURER,
56 serial_number=room_id_str,
57 suggested_area=room_name,
58 via_device=(DOMAIN, config_entry_id),
59 configuration_url=f
"http://{scene.host}/control",
63 """Activate scene. Try to get entities into requested state."""
None async_activate(self, **Any kwargs)
None __init__(self, str config_entry_id, WMS_Scene scene)
None async_setup_entry(HomeAssistant hass, WebControlProConfigEntry config_entry, AddEntitiesCallback async_add_entities)