diff --git a/homeassistant/components/config/scene.py b/homeassistant/components/config/scene.py index 19cfb7cd31a..8507fbbe47d 100644 --- a/homeassistant/components/config/scene.py +++ b/homeassistant/components/config/scene.py @@ -66,13 +66,11 @@ class EditSceneConfigView(EditIdBasedConfigView): # Iterate through some keys that we want to have ordered in the output updated_value = OrderedDict() for key in ("id", "name", "entities"): - if key in cur_value: - updated_value[key] = cur_value[key] if key in new_value: updated_value[key] = new_value[key] # We cover all current fields above, but just in case we start # supporting more fields in the future. - updated_value.update(cur_value) updated_value.update(new_value) + data[index] = updated_value diff --git a/homeassistant/components/config/script.py b/homeassistant/components/config/script.py index a5d1bb2037b..73b1ee0be5c 100644 --- a/homeassistant/components/config/script.py +++ b/homeassistant/components/config/script.py @@ -16,7 +16,7 @@ async def async_setup(hass): await hass.services.async_call(DOMAIN, SERVICE_RELOAD) hass.http.register_view( - EditKeyBasedConfigView( + EditScriptConfigView( DOMAIN, "config", SCRIPT_CONFIG_PATH, @@ -27,3 +27,11 @@ async def async_setup(hass): ) ) return True + + +class EditScriptConfigView(EditKeyBasedConfigView): + """Edit script config.""" + + def _write_value(self, hass, data, config_key, new_value): + """Set value.""" + data[config_key] = new_value