From fe1a85047e74bcbd6d7e58f7106c7867a430eba2 Mon Sep 17 00:00:00 2001 From: Thom Troy Date: Sat, 10 Feb 2018 23:06:24 +0000 Subject: [PATCH] have climate fallback to state if no ATTR_OPERATION_MODE (#12271) (#12279) --- 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 b718c009160..a2444e46ec1 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