Guard against unavailable climate entities (#25978)
This commit is contained in:
parent
715bb286c4
commit
ce35f64d59
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue