From 1de002013fbb11bc2dc988743a5c17a81fa6cdbf Mon Sep 17 00:00:00 2001 From: Mark Coombes Date: Fri, 27 Sep 2019 10:45:50 -0400 Subject: [PATCH] Fix ecobee integration (#26951) * Check for DATA_ECOBEE_CONFIG * Update homeassistant/components/ecobee/config_flow.py Co-Authored-By: Martin Hjelmare --- homeassistant/components/ecobee/config_flow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/ecobee/config_flow.py b/homeassistant/components/ecobee/config_flow.py index f4cd4fc5bf0..56ce13f7701 100644 --- a/homeassistant/components/ecobee/config_flow.py +++ b/homeassistant/components/ecobee/config_flow.py @@ -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.