Fix deconz SSDP updating Hassio discovery (#30153)
This commit is contained in:
parent
e74c4c5d99
commit
e9b19e0465
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue