From 085b44e45afecdc25563b47503e6bef3f9ee73fe Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 29 Mar 2022 07:09:42 +0200 Subject: [PATCH] Simplify is_on state for switch groups (#68805) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- homeassistant/components/group/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/group/switch.py b/homeassistant/components/group/switch.py index cbee6902f02..6b879e55cea 100644 --- a/homeassistant/components/group/switch.py +++ b/homeassistant/components/group/switch.py @@ -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)