From 6bb5e4229dcb5c628b1038bac53e7ae41e9a1700 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 28 Sep 2020 16:10:05 +0200 Subject: [PATCH] update yaml settings --- custom_components/adaptive_lighting/config_flow.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/config_flow.py b/custom_components/adaptive_lighting/config_flow.py index 7002c7d7..543363a2 100644 --- a/custom_components/adaptive_lighting/config_flow.py +++ b/custom_components/adaptive_lighting/config_flow.py @@ -43,7 +43,12 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async def async_step_import(self, user_input=None): """Handle configuration by yaml file.""" await self.async_set_unique_id(user_input["name"]) - self._abort_if_unique_id_configured() + for entry in self._async_current_entries(): + if entry.unique_id == self.unique_id: + self.hass.config_entries.async_update_entry( + entry, data=dict(entry.data, **user_input) + ) + return return self.async_create_entry(title=user_input["name"], data=user_input) @staticmethod