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

Fix restoring UniFi clients with bad unique id
pull/105757/head
Robert Svensson 2023-12-13 22:35:41 +01:00 committed by Franck Nijhof
parent d5ecc55f89
commit 3adda6b110
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
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: