Ensure homekit accessory reset only affect the bridges with the accessory (#37588)

This commit is contained in:
J. Nick Koston 2020-07-06 19:27:25 -05:00 committed by GitHub
parent bea3d841d2
commit 27ef8a1ced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -416,12 +416,21 @@ class HomeKit:
for entity_id in entity_ids:
aid = aid_storage.get_or_allocate_aid_for_entity_id(entity_id)
if aid not in self.bridge.accessories:
_LOGGER.warning(
"Could not reset accessory. entity_id not found %s", entity_id
)
continue
_LOGGER.info(
"HomeKit Bridge %s will reset accessory with linked entity_id %s",
self._name,
entity_id,
)
acc = self.remove_bridge_accessory(aid)
removed.append(acc)
if not removed:
# No matched accessories, probably on another bridge
return
self.driver.config_changed()
for acc in removed: