mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
changed scene name to unique powerview id's
This commit is contained in:
parent
afd1e6a5cc
commit
ebd053824d
@ -6,7 +6,8 @@ https://home-assistant.io/components/scene/
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.scene import Scene
|
from homeassistant.components.scene import Scene, DOMAIN
|
||||||
|
from homeassistant.helpers.entity import generate_entity_id
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
REQUIREMENTS = [
|
REQUIREMENTS = [
|
||||||
@ -46,6 +47,10 @@ class PowerViewScene(Scene):
|
|||||||
self.hass = hass
|
self.hass = hass
|
||||||
self.scene_data = scene_data
|
self.scene_data = scene_data
|
||||||
self._sync_room_data(room_data)
|
self._sync_room_data(room_data)
|
||||||
|
self.entity_id_format = DOMAIN + '.{}'
|
||||||
|
self.entity_id = generate_entity_id(self.entity_id_format,
|
||||||
|
str(self.scene_data["id"]),
|
||||||
|
hass=hass)
|
||||||
|
|
||||||
def _sync_room_data(self, room_data):
|
def _sync_room_data(self, room_data):
|
||||||
"""Sync the room data."""
|
"""Sync the room data."""
|
||||||
@ -57,7 +62,7 @@ class PowerViewScene(Scene):
|
|||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the scene."""
|
"""Return the name of the scene."""
|
||||||
return self.scene_data["name"]
|
return str(self.scene_data["name"])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user