From 2c471cc9819dd587f448660021aed78f80e4f687 Mon Sep 17 00:00:00 2001 From: tomaae <23486452+tomaae@users.noreply.github.com> Date: Fri, 10 Apr 2020 09:18:09 +0200 Subject: [PATCH] fixed restore from HA device registry when device name contains "-" #24 --- custom_components/mikrotik_router/mikrotik_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/mikrotik_router/mikrotik_controller.py b/custom_components/mikrotik_router/mikrotik_controller.py index 9abc9ea..52108fd 100644 --- a/custom_components/mikrotik_router/mikrotik_controller.py +++ b/custom_components/mikrotik_router/mikrotik_controller.py @@ -868,7 +868,7 @@ class MikrotikControllerData: if entity.config_entry_id == self.config_entry.entry_id \ and entity.domain == DEVICE_TRACKER_DOMAIN \ and "-host-" in entity.unique_id: - _, _, mac = entity.unique_id.split("-", 3) + _, mac = entity.unique_id.split("-host-", 2) self.data["host_hass"][mac] = entity.original_name # ---------------------------