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."""
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',

View file

@ -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."""