mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
enable grouped light if enabled in previous integration (#61582)
This commit is contained in:
parent
0194f0a06e
commit
599d5c4c41
@ -24,7 +24,7 @@ from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from ..bridge import HueBridge
|
||||
from ..const import DOMAIN
|
||||
from ..const import CONF_ALLOW_HUE_GROUPS, DOMAIN
|
||||
from .entity import HueBaseEntity
|
||||
|
||||
ALLOWED_ERRORS = [
|
||||
@ -76,8 +76,6 @@ async def async_setup_entry(
|
||||
class GroupedHueLight(HueBaseEntity, LightEntity):
|
||||
"""Representation of a Grouped Hue light."""
|
||||
|
||||
# Entities for Hue groups are disabled by default
|
||||
_attr_entity_registry_enabled_default = False
|
||||
_attr_icon = "mdi:lightbulb-group"
|
||||
|
||||
def __init__(
|
||||
@ -92,6 +90,12 @@ class GroupedHueLight(HueBaseEntity, LightEntity):
|
||||
self.api: HueBridgeV2 = bridge.api
|
||||
self._attr_supported_features |= SUPPORT_TRANSITION
|
||||
|
||||
# Entities for Hue groups are disabled by default
|
||||
# unless they were enabled in old version (legacy option)
|
||||
self._attr_entity_registry_enabled_default = bridge.config_entry.data.get(
|
||||
CONF_ALLOW_HUE_GROUPS, False
|
||||
)
|
||||
|
||||
self._update_values()
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user