Fix ecobee flaky test (#25019)

This commit is contained in:
Paulus Schoutsen 2019-07-08 13:10:01 -07:00 committed by GitHub
parent 662e0dde80
commit 0b7a901c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,5 @@
"""Support for Ecobee Thermostats.""" """Support for Ecobee Thermostats."""
import collections
import logging import logging
from typing import Optional from typing import Optional
@ -31,13 +32,14 @@ PRESET_HOLD_NEXT_TRANSITION = 'next_transition'
PRESET_HOLD_INDEFINITE = 'indefinite' PRESET_HOLD_INDEFINITE = 'indefinite'
AWAY_MODE = 'awayMode' AWAY_MODE = 'awayMode'
ECOBEE_HVAC_TO_HASS = { # Order matters, because for reverse mapping we don't want to map HEAT to AUX
'auxHeatOnly': HVAC_MODE_HEAT, ECOBEE_HVAC_TO_HASS = collections.OrderedDict([
'heat': HVAC_MODE_HEAT, ('heat', HVAC_MODE_HEAT),
'cool': HVAC_MODE_COOL, ('cool', HVAC_MODE_COOL),
'off': HVAC_MODE_OFF, ('auto', HVAC_MODE_AUTO),
'auto': HVAC_MODE_AUTO, ('off', HVAC_MODE_OFF),
} ('auxHeatOnly', HVAC_MODE_HEAT),
])
PRESET_TO_ECOBEE_HOLD = { PRESET_TO_ECOBEE_HOLD = {
PRESET_HOLD_NEXT_TRANSITION: 'nextTransition', PRESET_HOLD_NEXT_TRANSITION: 'nextTransition',

View File

@ -203,7 +203,7 @@ class TestEcobee(unittest.TestCase):
self.data.reset_mock() self.data.reset_mock()
self.thermostat.set_hvac_mode('heat') self.thermostat.set_hvac_mode('heat')
self.data.ecobee.set_hvac_mode.assert_has_calls( 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): def test_set_fan_min_on_time(self):
"""Test fan min on time setter.""" """Test fan min on time setter."""