mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Simplify is_on state for switch groups (#68805)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
parent
69fcce3b2c
commit
085b44e45a
@ -168,6 +168,6 @@ class SwitchGroup(GroupEntity, SwitchEntity):
|
|||||||
self._attr_is_on = None
|
self._attr_is_on = None
|
||||||
else:
|
else:
|
||||||
# Set as ON if any / all member is ON
|
# Set as ON if any / all member is ON
|
||||||
self._attr_is_on = self.mode(list(map(lambda x: x == STATE_ON, states)))
|
self._attr_is_on = self.mode(state == STATE_ON for state in states)
|
||||||
|
|
||||||
self._attr_available = any(state != STATE_UNAVAILABLE for state in states)
|
self._attr_available = any(state != STATE_UNAVAILABLE for state in states)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user