From 4b39bf7e5bc49e9c2bebd88b1f236ca32968f8b6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 26 Sep 2023 09:57:25 -0500 Subject: [PATCH] Small cleanup to isy994 extra_state_attributes (#100935) --- homeassistant/components/isy994/entity.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/isy994/entity.py b/homeassistant/components/isy994/entity.py index 80319b83ba2..a93f2d91d31 100644 --- a/homeassistant/components/isy994/entity.py +++ b/homeassistant/components/isy994/entity.py @@ -112,19 +112,19 @@ class ISYNodeEntity(ISYEntity): other attributes which have been picked up from the event stream and the combined result are returned as the device state attributes. """ - attr = {} + attrs = self._attrs node = self._node # Insteon aux_properties are now their own sensors - if hasattr(self._node, "aux_properties") and node.protocol != PROTO_INSTEON: + # so we no longer need to add them to the attributes + if node.protocol != PROTO_INSTEON and hasattr(node, "aux_properties"): for name, value in self._node.aux_properties.items(): attr_name = COMMAND_FRIENDLY_NAME.get(name, name) - attr[attr_name] = str(value.formatted).lower() + attrs[attr_name] = str(value.formatted).lower() # If a Group/Scene, set a property if the entire scene is on/off - if hasattr(self._node, "group_all_on"): - attr["group_all_on"] = STATE_ON if self._node.group_all_on else STATE_OFF + if hasattr(node, "group_all_on"): + attrs["group_all_on"] = STATE_ON if node.group_all_on else STATE_OFF - self._attrs.update(attr) return self._attrs async def async_send_node_command(self, command: str) -> None: