mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
home-assistant/home-assistant#18645: Fix climate mode mapping.
This commit is contained in:
parent
dd92318762
commit
471d94b6cd
@ -517,7 +517,10 @@ class TemperatureSettingTrait(_Trait):
|
|||||||
climate.STATE_HEAT: 'heat',
|
climate.STATE_HEAT: 'heat',
|
||||||
climate.STATE_COOL: 'cool',
|
climate.STATE_COOL: 'cool',
|
||||||
climate.STATE_OFF: 'off',
|
climate.STATE_OFF: 'off',
|
||||||
climate.STATE_AUTO: 'heatcool',
|
climate.STATE_AUTO: 'auto',
|
||||||
|
climate.STATE_FAN_ONLY: 'fan-only',
|
||||||
|
climate.STATE_DRY: 'dry',
|
||||||
|
climate.STATE_ECO: 'eco'
|
||||||
}
|
}
|
||||||
google_to_hass = {value: key for key, value in hass_to_google.items()}
|
google_to_hass = {value: key for key, value in hass_to_google.items()}
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ DEMO_DEVICES = [{
|
|||||||
'type': 'action.devices.types.THERMOSTAT',
|
'type': 'action.devices.types.THERMOSTAT',
|
||||||
'willReportState': False,
|
'willReportState': False,
|
||||||
'attributes': {
|
'attributes': {
|
||||||
'availableThermostatModes': 'heat,cool,heatcool,off',
|
'availableThermostatModes': 'heat,cool,auto,off',
|
||||||
'thermostatTemperatureUnit': 'C',
|
'thermostatTemperatureUnit': 'C',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
@ -214,7 +214,7 @@ def test_query_climate_request(hass_fixture, assistant_client, auth_header):
|
|||||||
'online': True,
|
'online': True,
|
||||||
'thermostatTemperatureSetpointHigh': 24,
|
'thermostatTemperatureSetpointHigh': 24,
|
||||||
'thermostatTemperatureAmbient': 23,
|
'thermostatTemperatureAmbient': 23,
|
||||||
'thermostatMode': 'heatcool',
|
'thermostatMode': 'auto',
|
||||||
'thermostatTemperatureSetpointLow': 21
|
'thermostatTemperatureSetpointLow': 21
|
||||||
}
|
}
|
||||||
assert devices['climate.hvac'] == {
|
assert devices['climate.hvac'] == {
|
||||||
@ -271,7 +271,7 @@ def test_query_climate_request_f(hass_fixture, assistant_client, auth_header):
|
|||||||
'online': True,
|
'online': True,
|
||||||
'thermostatTemperatureSetpointHigh': -4.4,
|
'thermostatTemperatureSetpointHigh': -4.4,
|
||||||
'thermostatTemperatureAmbient': -5,
|
'thermostatTemperatureAmbient': -5,
|
||||||
'thermostatMode': 'heatcool',
|
'thermostatMode': 'auto',
|
||||||
'thermostatTemperatureSetpointLow': -6.1,
|
'thermostatTemperatureSetpointLow': -6.1,
|
||||||
}
|
}
|
||||||
assert devices['climate.hvac'] == {
|
assert devices['climate.hvac'] == {
|
||||||
|
@ -679,11 +679,11 @@ async def test_temperature_setting_climate_range(hass):
|
|||||||
climate.ATTR_MAX_TEMP: 80
|
climate.ATTR_MAX_TEMP: 80
|
||||||
}), BASIC_CONFIG)
|
}), BASIC_CONFIG)
|
||||||
assert trt.sync_attributes() == {
|
assert trt.sync_attributes() == {
|
||||||
'availableThermostatModes': 'off,cool,heat,heatcool',
|
'availableThermostatModes': 'off,cool,heat,auto',
|
||||||
'thermostatTemperatureUnit': 'F',
|
'thermostatTemperatureUnit': 'F',
|
||||||
}
|
}
|
||||||
assert trt.query_attributes() == {
|
assert trt.query_attributes() == {
|
||||||
'thermostatMode': 'heatcool',
|
'thermostatMode': 'auto',
|
||||||
'thermostatTemperatureAmbient': 21.1,
|
'thermostatTemperatureAmbient': 21.1,
|
||||||
'thermostatHumidityAmbient': 25,
|
'thermostatHumidityAmbient': 25,
|
||||||
'thermostatTemperatureSetpointLow': 18.3,
|
'thermostatTemperatureSetpointLow': 18.3,
|
||||||
@ -709,7 +709,7 @@ async def test_temperature_setting_climate_range(hass):
|
|||||||
calls = async_mock_service(
|
calls = async_mock_service(
|
||||||
hass, climate.DOMAIN, climate.SERVICE_SET_OPERATION_MODE)
|
hass, climate.DOMAIN, climate.SERVICE_SET_OPERATION_MODE)
|
||||||
await trt.execute(trait.COMMAND_THERMOSTAT_SET_MODE, {
|
await trt.execute(trait.COMMAND_THERMOSTAT_SET_MODE, {
|
||||||
'thermostatMode': 'heatcool',
|
'thermostatMode': 'auto',
|
||||||
})
|
})
|
||||||
assert len(calls) == 1
|
assert len(calls) == 1
|
||||||
assert calls[0].data == {
|
assert calls[0].data == {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user