From e9b19e0465b36c7a41d8e530f0a7b122c2483e0b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 22 Dec 2019 22:24:18 +0100 Subject: [PATCH] Fix deconz SSDP updating Hassio discovery (#30153) --- homeassistant/components/deconz/config_flow.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/deconz/config_flow.py b/homeassistant/components/deconz/config_flow.py index c2035d61d6e..62b8190ff63 100644 --- a/homeassistant/components/deconz/config_flow.py +++ b/homeassistant/components/deconz/config_flow.py @@ -160,7 +160,11 @@ class DeconzFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): def _update_entry(self, entry, host, port, api_key=None): """Update existing entry.""" - if entry.data[CONF_HOST] == host: + if ( + entry.data[CONF_HOST] == host + and entry.data[CONF_PORT] == port + and (api_key is None or entry.data[CONF_API_KEY] == api_key) + ): return self.async_abort(reason="already_configured") entry.data[CONF_HOST] = host @@ -187,6 +191,8 @@ class DeconzFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): for entry in self.hass.config_entries.async_entries(DOMAIN): if uuid == entry.data.get(CONF_UUID): + if entry.source == "hassio": + return self.async_abort(reason="already_configured") return self._update_entry( entry, discovery_info[CONF_HOST], entry.data.get(CONF_PORT) )