Fix ecobee integration (#26951)

* Check for DATA_ECOBEE_CONFIG

* Update homeassistant/components/ecobee/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
This commit is contained in:
Mark Coombes 2019-09-27 10:45:50 -04:00 committed by Martin Hjelmare
parent e989239e19
commit 1de002013f

View file

@ -33,7 +33,11 @@ class EcobeeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
return self.async_abort(reason="one_instance_only")
errors = {}
stored_api_key = self.hass.data[DATA_ECOBEE_CONFIG].get(CONF_API_KEY)
stored_api_key = (
self.hass.data[DATA_ECOBEE_CONFIG].get(CONF_API_KEY)
if DATA_ECOBEE_CONFIG in self.hass.data
else ""
)
if user_input is not None:
# Use the user-supplied API key to attempt to obtain a PIN from ecobee.