File tree 1 file changed +6
-9
lines changed
custom_components/pyscript
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):
81
81
_LOGGER .error (err )
82
82
return
83
83
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 )
93
90
94
91
State .set_pyscript_config (config_entry .data )
95
92
You can’t perform that action at this time.
0 commit comments