From 860557830178cc96419e09c5a3711c23daa8c75d Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 25 Aug 2020 18:21:48 +0200 Subject: [PATCH] more simplifications --- custom_components/circadian_lighting/switch.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 7750ea6e..e33053e9 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -178,9 +178,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): self.hass = hass self._cl = cl self._name = name - self._entity_id = "switch." + slugify( - "{} {}".format("circadian_lighting", name) - ) + self._entity_id = "switch." + slugify(f"circadian_lighting {name}") self._state = None self._icon = ICON self._hs_color = None @@ -198,9 +196,7 @@ class CircadianSwitch(SwitchEntity, RestoreEntity): self._disable_entity = disable_entity self._disable_state = disable_state self._initial_transition = initial_transition - self._attributes = {} - self._attributes["hs_color"] = self._hs_color - self._attributes["brightness"] = None + self._attributes = {"hs_color": self._hs_color, "brightness": None} self._lights = [] if lights_ct is not None: