mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix ZHA light group on state (#33308)
This commit is contained in:
parent
ff391e538a
commit
5ce31cb383
@ -106,7 +106,6 @@ class BaseLight(BaseZhaEntity, light.Light):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self._is_on: bool = False
|
|
||||||
self._available: bool = False
|
self._available: bool = False
|
||||||
self._brightness: Optional[int] = None
|
self._brightness: Optional[int] = None
|
||||||
self._off_brightness: Optional[int] = None
|
self._off_brightness: Optional[int] = None
|
||||||
@ -525,7 +524,7 @@ class LightGroup(BaseLight):
|
|||||||
states: List[State] = list(filter(None, all_states))
|
states: List[State] = list(filter(None, all_states))
|
||||||
on_states = [state for state in states if state.state == STATE_ON]
|
on_states = [state for state in states if state.state == STATE_ON]
|
||||||
|
|
||||||
self._is_on = len(on_states) > 0
|
self._state = len(on_states) > 0
|
||||||
self._available = any(state.state != STATE_UNAVAILABLE for state in states)
|
self._available = any(state.state != STATE_UNAVAILABLE for state in states)
|
||||||
|
|
||||||
self._brightness = helpers.reduce_attribute(on_states, ATTR_BRIGHTNESS)
|
self._brightness = helpers.reduce_attribute(on_states, ATTR_BRIGHTNESS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user