Support STATE_AUTO in homekit_controller climate (#23583)
This commit is contained in:
parent
75abfd49ef
commit
0fe21f2015
4 changed files with 19 additions and 3 deletions
|
@ -128,7 +128,15 @@ class FakeCharacteristic(AbstractCharacteristic):
|
|||
needed even though it doesn't add any methods.
|
||||
"""
|
||||
|
||||
pass
|
||||
def to_accessory_and_service_list(self):
|
||||
"""Serialize the characteristic."""
|
||||
# Upstream doesn't correctly serialize valid_values
|
||||
# This fix will be upstreamed and this function removed when it
|
||||
# is fixed.
|
||||
record = super().to_accessory_and_service_list()
|
||||
if self.valid_values:
|
||||
record['valid-values'] = self.valid_values
|
||||
return record
|
||||
|
||||
|
||||
class FakeService(AbstractService):
|
||||
|
|
|
@ -37,6 +37,13 @@ async def test_ecobee3_setup(hass):
|
|||
SUPPORT_OPERATION_MODE
|
||||
)
|
||||
|
||||
assert climate_state.attributes['operation_list'] == [
|
||||
'off',
|
||||
'heat',
|
||||
'cool',
|
||||
'auto',
|
||||
]
|
||||
|
||||
assert climate_state.attributes['min_temp'] == 7.2
|
||||
assert climate_state.attributes['max_temp'] == 33.3
|
||||
assert climate_state.attributes['min_humidity'] == 20
|
||||
|
|
|
@ -58,7 +58,7 @@ async def test_climate_respect_supported_op_modes_2(hass, utcnow):
|
|||
service = FakeService('public.hap.service.thermostat')
|
||||
char = service.add_characteristic('heating-cooling.target')
|
||||
char.value = 0
|
||||
char.validValues = [0, 1, 2]
|
||||
char.valid_values = [0, 1, 2]
|
||||
|
||||
helper = await setup_test_component(hass, [service])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue