Fix restoring UniFi clients with old unique id (#105691)

Fix restoring UniFi clients with bad unique id
pull/105711/head
Robert Svensson 2023-12-13 22:35:41 +01:00 committed by GitHub
parent 72cb21d875
commit 7084889b78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -260,8 +260,8 @@ class UniFiController:
for entry in async_entries_for_config_entry(
entity_registry, self.config_entry.entry_id
):
if entry.domain == Platform.DEVICE_TRACKER:
macs.append(entry.unique_id.split("-", 1)[0])
if entry.domain == Platform.DEVICE_TRACKER and "-" in entry.unique_id:
macs.append(entry.unique_id.split("-", 1)[1])
for mac in self.option_supported_clients + self.option_block_clients + macs:
if mac not in self.api.clients and mac in self.api.clients_all: