From 47cd44e4d86d679176cecc295c59db284f3609ce Mon Sep 17 00:00:00 2001 From: Thom Troy Date: Sat, 10 Feb 2018 21:13:49 +0000 Subject: [PATCH] have climate fallback to state if no ATTR_OPERATION_MODE (#12271) --- homeassistant/components/google_assistant/smart_home.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/google_assistant/smart_home.py b/homeassistant/components/google_assistant/smart_home.py index b718c00916029b..a2444e46ec182d 100644 --- a/homeassistant/components/google_assistant/smart_home.py +++ b/homeassistant/components/google_assistant/smart_home.py @@ -237,7 +237,10 @@ def query_response_sensor( def query_response_climate( entity: Entity, config: Config, units: UnitSystem) -> dict: """Convert a climate entity to a QUERY response.""" - mode = entity.attributes.get(climate.ATTR_OPERATION_MODE).lower() + mode = entity.attributes.get(climate.ATTR_OPERATION_MODE) + if mode is None: + mode = entity.state + mode = mode.lower() if mode not in CLIMATE_SUPPORTED_MODES: mode = 'heat' attrs = entity.attributes