Fix ESPHome discovery for ignored config entries (#36964)

This commit is contained in:
Franck Nijhof 2020-06-21 00:39:08 +02:00 committed by GitHub
parent 9f65dcf4ba
commit 46cb9cff41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,10 +100,10 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN):
for entry in self._async_current_entries():
already_configured = False
if (
entry.data[CONF_HOST] == address
or entry.data[CONF_HOST] == discovery_info[CONF_HOST]
):
if CONF_HOST in entry.data and entry.data[CONF_HOST] in [
address,
discovery_info[CONF_HOST],
]:
# Is this address or IP address already configured?
already_configured = True
elif entry.entry_id in self.hass.data.get(DATA_KEY, {}):