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
1 changed files with 1 additions and 1 deletions
|
@ -168,6 +168,6 @@ class SwitchGroup(GroupEntity, SwitchEntity):
|
|||
self._attr_is_on = None
|
||||
else:
|
||||
# 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)
|
||||
|
|
Loading…
Add table
Reference in a new issue