Handle situation where mac might not exist in clients (#71016)

pull/71022/head
Robert Svensson 2022-04-28 20:36:52 +02:00 committed by GitHub
parent 70e8f81be1
commit caf71c854f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -107,11 +107,11 @@ def add_client_entities(controller, async_add_entities, clients):
trackers = []
for mac in clients:
if mac in controller.entities[DOMAIN][UniFiClientTracker.TYPE]:
if mac in controller.entities[DOMAIN][UniFiClientTracker.TYPE] or not (
client := controller.api.clients.get(mac)
):
continue
client = controller.api.clients[mac]
if mac not in controller.wireless_clients:
if not controller.option_track_wired_clients:
continue