From ce35f64d597f68fcd52b558163bdd33a8c8fb316 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 16 Aug 2019 07:17:43 -0700 Subject: [PATCH] Guard against unavailable climate entities (#25978) --- homeassistant/components/alexa/entities.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/alexa/entities.py b/homeassistant/components/alexa/entities.py index b060d35be90..03d153f5927 100644 --- a/homeassistant/components/alexa/entities.py +++ b/homeassistant/components/alexa/entities.py @@ -264,7 +264,9 @@ class ClimateCapabilities(AlexaEntity): def interfaces(self): """Yield the supported interfaces.""" # If we support two modes, one being off, we allow turning on too. - if climate.HVAC_MODE_OFF in self.entity.attributes[climate.ATTR_HVAC_MODES]: + if climate.HVAC_MODE_OFF in self.entity.attributes.get( + climate.ATTR_HVAC_MODES, [] + ): yield AlexaPowerController(self.entity) yield AlexaThermostatController(self.hass, self.entity)