Remove temporary variable by only retrieving needed value (#42522)

This commit is contained in:
springstan
2020-11-29 00:44:25 +01:00
committed by GitHub
parent 65ab8cbc71
commit d5efb3e3de
9 changed files with 29 additions and 29 deletions

View File

@@ -345,9 +345,9 @@ class UniFiController:
mac = ""
if entity.domain == TRACKER_DOMAIN:
mac, _ = entity.unique_id.split("-", 1)
mac = entity.unique_id.split("-", 1)[0]
elif entity.domain == SWITCH_DOMAIN:
_, mac = entity.unique_id.split("-", 1)
mac = entity.unique_id.split("-", 1)[1]
if mac in self.api.clients or mac not in self.api.clients_all:
continue