From ab5dfb3c42426c184afae3c405c58817bb312076 Mon Sep 17 00:00:00 2001 From: Nephiel Date: Fri, 29 Jul 2022 12:08:32 +0200 Subject: [PATCH] Use climate enums in google_assistant (#75888) --- .../components/google_assistant/trait.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/google_assistant/trait.py b/homeassistant/components/google_assistant/trait.py index ee41dd0c678..edc8ed124b3 100644 --- a/homeassistant/components/google_assistant/trait.py +++ b/homeassistant/components/google_assistant/trait.py @@ -864,13 +864,13 @@ class TemperatureSettingTrait(_Trait): # We do not support "on" as we are unable to know how to restore # the last mode. hvac_to_google = { - climate.HVAC_MODE_HEAT: "heat", - climate.HVAC_MODE_COOL: "cool", - climate.HVAC_MODE_OFF: "off", - climate.HVAC_MODE_AUTO: "auto", - climate.HVAC_MODE_HEAT_COOL: "heatcool", - climate.HVAC_MODE_FAN_ONLY: "fan-only", - climate.HVAC_MODE_DRY: "dry", + climate.HVACMode.HEAT: "heat", + climate.HVACMode.COOL: "cool", + climate.HVACMode.OFF: "off", + climate.HVACMode.AUTO: "auto", + climate.HVACMode.HEAT_COOL: "heatcool", + climate.HVACMode.FAN_ONLY: "fan-only", + climate.HVACMode.DRY: "dry", } google_to_hvac = {value: key for key, value in hvac_to_google.items()} @@ -949,7 +949,7 @@ class TemperatureSettingTrait(_Trait): if current_humidity is not None: response["thermostatHumidityAmbient"] = current_humidity - if operation in (climate.HVAC_MODE_AUTO, climate.HVAC_MODE_HEAT_COOL): + if operation in (climate.HVACMode.AUTO, climate.HVACMode.HEAT_COOL): if supported & climate.SUPPORT_TARGET_TEMPERATURE_RANGE: response["thermostatTemperatureSetpointHigh"] = round( temp_util.convert(