UniFi - dont schedule updates on disabled entities (#26278)

* Dont schedule updates on disabled entities

* Use entity enabled since it is available
pull/26297/head
Robert Svensson 2019-08-29 23:04:01 +02:00 committed by Paulus Schoutsen
parent 6a02fd51b8
commit 0d7326168e
1 changed files with 6 additions and 2 deletions

View File

@ -150,7 +150,9 @@ def update_items(controller, async_add_entities, tracked):
for client_id in controller.api.clients:
if client_id in tracked and tracked[client_id].entity_id:
if client_id in tracked:
if not tracked[client_id].enabled:
continue
LOGGER.debug(
"Updating UniFi tracked client %s (%s)",
tracked[client_id].entity_id,
@ -183,7 +185,9 @@ def update_items(controller, async_add_entities, tracked):
for device_id in controller.api.devices:
if device_id in tracked and tracked[device_id].entity_id:
if device_id in tracked:
if not tracked[device_id].enabled:
continue
LOGGER.debug(
"Updating UniFi tracked device %s (%s)",
tracked[device_id].entity_id,