From da0b2552b9667b840ecc3b82bfe160fa05294e89 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Thu, 22 Oct 2020 12:34:36 +0200 Subject: [PATCH] fix name bug --- custom_components/adaptive_lighting/switch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 611bd21a..c3979028 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -858,8 +858,9 @@ class SimpleSwitch(SwitchEntity, RestoreEntity): self._icon = ICON self._state = None self._which = which - self._unique_id = f"{self._name}_{slugify(self._which)}" - self._name = f"Adaptive Lighting {which}: {data[CONF_NAME]}" + name = data[CONF_NAME] + self._unique_id = f"{name}_{slugify(self._which)}" + self._name = f"Adaptive Lighting {which}: {name}" self._initial_state = initial_state @property