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

This commit is contained in:
Robert Svensson
2022-04-28 20:36:52 +02:00
committed by GitHub
parent 70e8f81be1
commit caf71c854f

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