Migrate evil genius labs to has entity name (#96570)
This commit is contained in:
parent
b53df429fa
commit
63115a906d
2 changed files with 3 additions and 5 deletions
|
@ -103,6 +103,8 @@ class EvilGeniusUpdateCoordinator(DataUpdateCoordinator[dict]):
|
||||||
class EvilGeniusEntity(CoordinatorEntity[EvilGeniusUpdateCoordinator]):
|
class EvilGeniusEntity(CoordinatorEntity[EvilGeniusUpdateCoordinator]):
|
||||||
"""Base entity for Evil Genius."""
|
"""Base entity for Evil Genius."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self) -> DeviceInfo:
|
def device_info(self) -> DeviceInfo:
|
||||||
"""Return device info."""
|
"""Return device info."""
|
||||||
|
|
|
@ -32,6 +32,7 @@ async def async_setup_entry(
|
||||||
class EvilGeniusLight(EvilGeniusEntity, LightEntity):
|
class EvilGeniusLight(EvilGeniusEntity, LightEntity):
|
||||||
"""Evil Genius Labs light."""
|
"""Evil Genius Labs light."""
|
||||||
|
|
||||||
|
_attr_name = None
|
||||||
_attr_supported_features = LightEntityFeature.EFFECT
|
_attr_supported_features = LightEntityFeature.EFFECT
|
||||||
_attr_supported_color_modes = {ColorMode.RGB}
|
_attr_supported_color_modes = {ColorMode.RGB}
|
||||||
_attr_color_mode = ColorMode.RGB
|
_attr_color_mode = ColorMode.RGB
|
||||||
|
@ -47,11 +48,6 @@ class EvilGeniusLight(EvilGeniusEntity, LightEntity):
|
||||||
]
|
]
|
||||||
self._attr_effect_list.insert(0, HA_NO_EFFECT)
|
self._attr_effect_list.insert(0, HA_NO_EFFECT)
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self) -> str:
|
|
||||||
"""Return name."""
|
|
||||||
return cast(str, self.coordinator.data["name"]["value"])
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
"""Return if light is on."""
|
"""Return if light is on."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue