mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Use shorthand attributes in Hunterdouglas powerview (#99386)
This commit is contained in:
parent
3d1efaa4ad
commit
f48e8623da
@ -35,25 +35,14 @@ async def async_setup_entry(
|
|||||||
class PowerViewScene(HDEntity, Scene):
|
class PowerViewScene(HDEntity, Scene):
|
||||||
"""Representation of a Powerview scene."""
|
"""Representation of a Powerview scene."""
|
||||||
|
|
||||||
|
_attr_icon = "mdi:blinds"
|
||||||
|
|
||||||
def __init__(self, coordinator, device_info, room_name, scene):
|
def __init__(self, coordinator, device_info, room_name, scene):
|
||||||
"""Initialize the scene."""
|
"""Initialize the scene."""
|
||||||
super().__init__(coordinator, device_info, room_name, scene.id)
|
super().__init__(coordinator, device_info, room_name, scene.id)
|
||||||
self._scene = scene
|
self._scene = scene
|
||||||
|
self._attr_name = scene.name
|
||||||
@property
|
self._attr_extra_state_attributes = {STATE_ATTRIBUTE_ROOM_NAME: room_name}
|
||||||
def name(self):
|
|
||||||
"""Return the name of the scene."""
|
|
||||||
return self._scene.name
|
|
||||||
|
|
||||||
@property
|
|
||||||
def extra_state_attributes(self):
|
|
||||||
"""Return the state attributes."""
|
|
||||||
return {STATE_ATTRIBUTE_ROOM_NAME: self._room_name}
|
|
||||||
|
|
||||||
@property
|
|
||||||
def icon(self):
|
|
||||||
"""Icon to use in the frontend."""
|
|
||||||
return "mdi:blinds"
|
|
||||||
|
|
||||||
async def async_activate(self, **kwargs: Any) -> None:
|
async def async_activate(self, **kwargs: Any) -> None:
|
||||||
"""Activate scene. Try to get entities into requested state."""
|
"""Activate scene. Try to get entities into requested state."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user