Fix deCONZ update entry from Hassio discovery (#31015)

* Fix deCONZ update entry from Hassio discovery

* Empty commit to re-trigger build
pull/31048/head
Franck Nijhof 2020-01-20 17:18:10 +01:00
parent 392cf57750
commit ccf6ce71cf
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
1 changed files with 8 additions and 8 deletions

View File

@ -216,15 +216,15 @@ class DeconzFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
This flow is triggered by the discovery component.
"""
self.bridge_id = normalize_bridge_id(user_input[CONF_SERIAL])
gateway = self.hass.data.get(DOMAIN, {}).get(self.bridge_id)
if gateway:
return self._update_entry(
gateway.config_entry,
user_input[CONF_HOST],
user_input[CONF_PORT],
user_input[CONF_API_KEY],
)
for entry in self.hass.config_entries.async_entries(DOMAIN):
if self.bridge_id == entry.unique_id:
return self._update_entry(
entry,
user_input[CONF_HOST],
user_input[CONF_PORT],
user_input[CONF_API_KEY],
)
await self.async_set_unique_id(self.bridge_id)
self._hassio_discovery = user_input