File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
custom_components/pyscript Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -81,15 +81,12 @@ async def reload_scripts_handler(call):
8181 _LOGGER .error (err )
8282 return
8383
84- if DOMAIN in conf :
85- config = PYSCRIPT_SCHEMA (conf [DOMAIN ])
86-
87- # If data in config doesn't match config entry, trigger a config import
88- # so that the config entry can get updated
89- if config != config_entry .data :
90- await hass .config_entries .flow .async_init (
91- DOMAIN , context = {"source" : SOURCE_IMPORT }, data = config
92- )
84+ config = PYSCRIPT_SCHEMA (conf .get (DOMAIN , {}))
85+
86+ # If data in config doesn't match config entry, trigger a config import
87+ # so that the config entry can get updated
88+ if config != config_entry .data :
89+ await hass .config_entries .flow .async_init (DOMAIN , context = {"source" : SOURCE_IMPORT }, data = config )
9390
9491 State .set_pyscript_config (config_entry .data )
9592
You can’t perform that action at this time.
0 commit comments