mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Fix deconz SSDP updating Hassio discovery (#30153)
This commit is contained in:
parent
e74c4c5d99
commit
e9b19e0465
@ -160,7 +160,11 @@ class DeconzFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
def _update_entry(self, entry, host, port, api_key=None):
|
def _update_entry(self, entry, host, port, api_key=None):
|
||||||
"""Update existing entry."""
|
"""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")
|
return self.async_abort(reason="already_configured")
|
||||||
|
|
||||||
entry.data[CONF_HOST] = host
|
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):
|
for entry in self.hass.config_entries.async_entries(DOMAIN):
|
||||||
if uuid == entry.data.get(CONF_UUID):
|
if uuid == entry.data.get(CONF_UUID):
|
||||||
|
if entry.source == "hassio":
|
||||||
|
return self.async_abort(reason="already_configured")
|
||||||
return self._update_entry(
|
return self._update_entry(
|
||||||
entry, discovery_info[CONF_HOST], entry.data.get(CONF_PORT)
|
entry, discovery_info[CONF_HOST], entry.data.get(CONF_PORT)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user