mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Guard against unavailable climate entities (#25978)
This commit is contained in:
parent
715bb286c4
commit
ce35f64d59
@ -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…
x
Reference in New Issue
Block a user