Add support for Heat Mode detection for ecobee Heat Pumps (#28273)

* Add support for Heat Mode detection for Heat Pumps - Fixes #26547

Since the ecobee component started to dynamically set the supported HVAC modes based on querying the device a few releases ago, users with Heat Pumps noticed that the Heat mode was no longer offered as an option by HA. Some of us did not actually notice until the summer was over :). This commit fixes that.

For heatpumps, ecobee returns:
'coolStages': 1, 
'heatStages': 0,
'hasHeatPump': True,

Fix tested on HA 100.1 and 100.3

Fixes bug https://github.com/home-assistant/home-assistant/issues/26547

* changed line formatted with black
This commit is contained in:
Ari 2019-11-08 13:08:50 -05:00 committed by Martin Hjelmare
parent caedc14b00
commit 504ad6488c

View File

@ -267,7 +267,10 @@ class Thermostat(ClimateDevice):
self._last_active_hvac_mode = HVAC_MODE_AUTO
self._operation_list = []
if self.thermostat["settings"]["heatStages"]:
if (
self.thermostat["settings"]["heatStages"]
or self.thermostat["settings"]["hasHeatPump"]
):
self._operation_list.append(HVAC_MODE_HEAT)
if self.thermostat["settings"]["coolStages"]:
self._operation_list.append(HVAC_MODE_COOL)