UniFi Protect cleanup and enable unadopted devices (#73860)

This commit is contained in:
Christopher Bailey 2022-06-22 16:57:21 -04:00 committed by GitHub
parent 5c5fd746fd
commit 01a9367281
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 258 additions and 114 deletions

View file

@ -120,7 +120,9 @@ class ProtectData:
@callback
def _async_process_ws_message(self, message: WSSubscriptionMessage) -> None:
# removed packets are not processed yet
if message.new_obj is None: # pragma: no cover
if message.new_obj is None or not getattr(
message.new_obj, "is_adopted_by_us", True
):
return
if message.new_obj.model in DEVICES_WITH_ENTITIES: