Skip to content

Commit

Permalink
Fix restoring UniFi clients with old unique id (#105691)
Browse files Browse the repository at this point in the history
Fix restoring UniFi clients with bad unique id
  • Loading branch information
Kane610 authored Dec 13, 2023
1 parent 72cb21d commit 7084889
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/unifi/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ async def initialize(self) -> None:
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:
Expand Down

0 comments on commit 7084889

Please sign in to comment.