mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-26 18:58:54 +02:00
Fixed duplication of tracker entities for restored entities #236
This commit is contained in:
parent
cbac88efd2
commit
d420a8ad06
1 changed files with 11 additions and 1 deletions
|
@ -469,7 +469,17 @@ class MikrotikControllerData:
|
|||
entity.config_entry_id == self.config_entry.entry_id
|
||||
and entity.entity_id.startswith("device_tracker.")
|
||||
):
|
||||
self.data["host_hass"][entity.unique_id.upper()] = entity.original_name
|
||||
tmp = entity.unique_id.split("-")
|
||||
if tmp[0] != self.name.lower():
|
||||
continue
|
||||
|
||||
if tmp[1] != "host":
|
||||
continue
|
||||
|
||||
if ":" not in tmp[2]:
|
||||
continue
|
||||
|
||||
self.data["host_hass"][tmp[2].upper()] = entity.original_name
|
||||
|
||||
# ---------------------------
|
||||
# async_hwinfo_update
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue