From 5513ffc33c31d7834716b3855a996f2784dd7af2 Mon Sep 17 00:00:00 2001 From: andrewdolphin <31809425+andrewdolphin@users.noreply.github.com> Date: Sun, 21 Jan 2018 20:57:56 +0000 Subject: [PATCH] Change 'on' to 'heat' as fallback thermostat mode (#11377) * Change 'on' to 'heat' as fallback thermostat mode 'on' isn't recognised as a mode by Google Assistant, rather is used as a method to return a thermostat to a previous mode. In the case where a thermostat doesn't support the standard google modes (e.g. A homematic radiator thermostat) this means the set_temperature doesn't get returned to the user on a request. * Update test_google_assistant.py --- homeassistant/components/google_assistant/smart_home.py | 2 +- tests/components/google_assistant/test_google_assistant.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/google_assistant/smart_home.py b/homeassistant/components/google_assistant/smart_home.py index 0faa9bdc484..f9d6135107b 100644 --- a/homeassistant/components/google_assistant/smart_home.py +++ b/homeassistant/components/google_assistant/smart_home.py @@ -151,7 +151,7 @@ def query_device(entity: Entity, units: UnitSystem) -> dict: if entity.domain == climate.DOMAIN: mode = entity.attributes.get(climate.ATTR_OPERATION_MODE).lower() if mode not in CLIMATE_SUPPORTED_MODES: - mode = 'on' + mode = 'heat' response = { 'thermostatMode': mode, 'thermostatTemperatureSetpoint': diff --git a/tests/components/google_assistant/test_google_assistant.py b/tests/components/google_assistant/test_google_assistant.py index 3b9ad7f3ef7..500e8ece143 100644 --- a/tests/components/google_assistant/test_google_assistant.py +++ b/tests/components/google_assistant/test_google_assistant.py @@ -215,7 +215,7 @@ def test_query_climate_request(hass_fixture, assistant_client): 'climate.ecobee': { 'thermostatTemperatureSetpointHigh': 24, 'thermostatTemperatureAmbient': 23, - 'thermostatMode': 'on', + 'thermostatMode': 'heat', 'thermostatTemperatureSetpointLow': 21 }, 'climate.hvac': { @@ -263,7 +263,7 @@ def test_query_climate_request_f(hass_fixture, assistant_client): 'climate.ecobee': { 'thermostatTemperatureSetpointHigh': -4.4, 'thermostatTemperatureAmbient': -5, - 'thermostatMode': 'on', + 'thermostatMode': 'heat', 'thermostatTemperatureSetpointLow': -6.1, }, 'climate.hvac': {