mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-15 08:14:04 +02:00
set name correctly
This commit is contained in:
parent
049fb8b983
commit
1aa6f8f345
1 changed files with 4 additions and 2 deletions
|
|
@ -129,8 +129,6 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
def __init__(self, hass, config_entry):
|
||||
"""Initialize the Adaptive Lighting switch."""
|
||||
self.hass = hass
|
||||
self._entity_id = f"switch.{DOMAIN}_{slugify(name)}"
|
||||
self._icon = ICON
|
||||
|
||||
data = validate(config_entry)
|
||||
self._name = data[CONF_NAME]
|
||||
|
|
@ -155,6 +153,10 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
self._sunset_time = data[CONF_SUNSET_TIME]
|
||||
self._transition = data[CONF_TRANSITION]
|
||||
|
||||
# Set other attributes
|
||||
self._icon = ICON
|
||||
self._entity_id = f"switch.{DOMAIN}_{slugify(self._name)}"
|
||||
|
||||
# Initialize attributes that will be set in self._update_attrs
|
||||
self._percent = None
|
||||
self._brightness = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue