diff --git a/homeassistant/components/ecobee/climate.py b/homeassistant/components/ecobee/climate.py index f9b450124dd..96ee9887bf2 100644 --- a/homeassistant/components/ecobee/climate.py +++ b/homeassistant/components/ecobee/climate.py @@ -1,4 +1,5 @@ """Support for Ecobee Thermostats.""" +import collections import logging from typing import Optional @@ -31,13 +32,14 @@ PRESET_HOLD_NEXT_TRANSITION = 'next_transition' PRESET_HOLD_INDEFINITE = 'indefinite' AWAY_MODE = 'awayMode' -ECOBEE_HVAC_TO_HASS = { - 'auxHeatOnly': HVAC_MODE_HEAT, - 'heat': HVAC_MODE_HEAT, - 'cool': HVAC_MODE_COOL, - 'off': HVAC_MODE_OFF, - 'auto': HVAC_MODE_AUTO, -} +# Order matters, because for reverse mapping we don't want to map HEAT to AUX +ECOBEE_HVAC_TO_HASS = collections.OrderedDict([ + ('heat', HVAC_MODE_HEAT), + ('cool', HVAC_MODE_COOL), + ('auto', HVAC_MODE_AUTO), + ('off', HVAC_MODE_OFF), + ('auxHeatOnly', HVAC_MODE_HEAT), +]) PRESET_TO_ECOBEE_HOLD = { PRESET_HOLD_NEXT_TRANSITION: 'nextTransition', diff --git a/tests/components/ecobee/test_climate.py b/tests/components/ecobee/test_climate.py index 180c7eb7a6a..6a0e9e08435 100644 --- a/tests/components/ecobee/test_climate.py +++ b/tests/components/ecobee/test_climate.py @@ -203,7 +203,7 @@ class TestEcobee(unittest.TestCase): self.data.reset_mock() self.thermostat.set_hvac_mode('heat') self.data.ecobee.set_hvac_mode.assert_has_calls( - [mock.call(1, 'auxHeatOnly')]) + [mock.call(1, 'heat')]) def test_set_fan_min_on_time(self): """Test fan min on time setter."""