Simplify Alexa/Google for new climate turn_on/off (#25115)

This commit is contained in:
Paulus Schoutsen 2019-07-13 01:27:50 -07:00 committed by Pascal Vizeli
parent 8ec75cf883
commit d37d1ce4ad
4 changed files with 30 additions and 37 deletions

View file

@ -249,8 +249,8 @@ class ClimateCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
# If we support two modes, one being off, we allow turning on too.
if len([v for v in self.entity.attributes[climate.ATTR_HVAC_MODES]
if v != climate.HVAC_MODE_OFF]) == 1:
if (climate.HVAC_MODE_OFF in
self.entity.attributes[climate.ATTR_HVAC_MODES]):
yield AlexaPowerController(self.entity)
yield AlexaThermostatController(self.hass, self.entity)