Prevent duplicate Matter attribute event subscription (#97194)

This commit is contained in:
Marcel van der Veldt 2023-07-25 12:14:22 +02:00 committed by GitHub
parent cd84a188ee
commit 5e40fe97fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,6 +78,9 @@ class MatterEntity(Entity):
sub_paths: list[str] = []
for attr_cls in self._entity_info.attributes_to_watch:
attr_path = self.get_matter_attribute_path(attr_cls)
if attr_path in sub_paths:
# prevent duplicate subscriptions
continue
self._attributes_map[attr_cls] = attr_path
sub_paths.append(attr_path)
self._unsubscribes.append(