-
-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Google assistant temperature setting active thermostat mode #166448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2a49ec5
412ed06
01e924d
0c88f16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1201,6 +1201,17 @@ class TemperatureSettingTrait(_Trait): | |||||||||
| preset_to_google = {climate.PRESET_ECO: "eco"} | ||||||||||
| google_to_preset = {value: key for key, value in preset_to_google.items()} | ||||||||||
|
|
||||||||||
| action_to_google = { | ||||||||||
| climate.HVACAction.OFF: "off", | ||||||||||
| climate.HVACAction.HEATING: "heat", | ||||||||||
| climate.HVACAction.DEFROSTING: "heat", | ||||||||||
| climate.HVACAction.PREHEATING: "heat", | ||||||||||
| climate.HVACAction.COOLING: "cool", | ||||||||||
| climate.HVACAction.DRYING: "dry", | ||||||||||
| climate.HVACAction.FAN: "fan-only", | ||||||||||
| climate.HVACAction.IDLE: "none", | ||||||||||
|
||||||||||
| climate.HVACAction.IDLE: "none", | |
| climate.HVACAction.IDLE: "none", | |
| climate.HVACAction.PREHEATING: "heat", | |
| climate.HVACAction.DEFROSTING: "heat", |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1625,6 +1625,44 @@ async def test_temperature_setting_climate_setpoint_auto(hass: HomeAssistant) -> | |
| assert calls[0].data == {ATTR_ENTITY_ID: "climate.bla", ATTR_TEMPERATURE: 19} | ||
|
|
||
|
|
||
| async def test_temperature_setting_action_change(hass: HomeAssistant) -> None: | ||
| """Test that activeThermostatMode contains the current HVAC action.""" | ||
| trt_idle = trait.TemperatureSettingTrait( | ||
| hass, | ||
| State( | ||
|
Comment on lines
+1628
to
+1632
|
||
| "climate.bla", | ||
| climate.HVACMode.COOL, | ||
| { | ||
| climate.ATTR_HVAC_MODES: [climate.HVACMode.OFF, climate.HVACMode.COOL], | ||
| climate.ATTR_HVAC_ACTION: climate.HVACAction.IDLE, | ||
| climate.ATTR_CURRENT_TEMPERATURE: 18, | ||
| climate.ATTR_MIN_TEMP: 10, | ||
| climate.ATTR_MAX_TEMP: 30, | ||
| ATTR_TEMPERATURE: 18, | ||
| }, | ||
| ), | ||
| BASIC_CONFIG, | ||
| ) | ||
| assert trt_idle.query_attributes().get("activeThermostatMode") == "none" | ||
| trt_cool = trait.TemperatureSettingTrait( | ||
| hass, | ||
| State( | ||
| "climate.bla", | ||
| climate.HVACMode.COOL, | ||
| { | ||
| climate.ATTR_HVAC_MODES: [climate.HVACMode.OFF, climate.HVACMode.COOL], | ||
| climate.ATTR_HVAC_ACTION: climate.HVACAction.COOLING, | ||
| climate.ATTR_CURRENT_TEMPERATURE: 23, | ||
| climate.ATTR_MIN_TEMP: 10, | ||
| climate.ATTR_MAX_TEMP: 30, | ||
| ATTR_TEMPERATURE: 18, | ||
| }, | ||
| ), | ||
| BASIC_CONFIG, | ||
| ) | ||
| assert trt_cool.query_attributes().get("activeThermostatMode") == "cool" | ||
|
|
||
|
|
||
| async def test_temperature_control(hass: HomeAssistant) -> None: | ||
| """Test TemperatureControl trait support for sensor domain.""" | ||
| trt = trait.TemperatureControlTrait( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.