mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
register service after async_add_entities
This commit is contained in:
parent
773a955b85
commit
91735ebd58
1 changed files with 2 additions and 1 deletions
|
|
@ -150,6 +150,8 @@ async def async_setup_entry(hass, config_entry: ConfigEntry, async_add_entities:
|
|||
data[config_entry.entry_id]["sleep_mode_switch"] = sleep_mode_switch
|
||||
data[config_entry.entry_id][SWITCH_DOMAIN] = switch
|
||||
|
||||
async_add_entities([switch, sleep_mode_switch], update_before_add=True)
|
||||
|
||||
# Register `apply` service
|
||||
platform = entity_platform.current_platform.get()
|
||||
platform.async_register_entity_service(
|
||||
|
|
@ -167,7 +169,6 @@ async def async_setup_entry(hass, config_entry: ConfigEntry, async_add_entities:
|
|||
},
|
||||
handle_apply,
|
||||
)
|
||||
async_add_entities([switch, sleep_mode_switch], update_before_add=True)
|
||||
|
||||
|
||||
def validate(config_entry):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue