mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Use climate enums in google_assistant (#75888)
This commit is contained in:
parent
08b169a7ad
commit
ab5dfb3c42
@ -864,13 +864,13 @@ class TemperatureSettingTrait(_Trait):
|
|||||||
# We do not support "on" as we are unable to know how to restore
|
# We do not support "on" as we are unable to know how to restore
|
||||||
# the last mode.
|
# the last mode.
|
||||||
hvac_to_google = {
|
hvac_to_google = {
|
||||||
climate.HVAC_MODE_HEAT: "heat",
|
climate.HVACMode.HEAT: "heat",
|
||||||
climate.HVAC_MODE_COOL: "cool",
|
climate.HVACMode.COOL: "cool",
|
||||||
climate.HVAC_MODE_OFF: "off",
|
climate.HVACMode.OFF: "off",
|
||||||
climate.HVAC_MODE_AUTO: "auto",
|
climate.HVACMode.AUTO: "auto",
|
||||||
climate.HVAC_MODE_HEAT_COOL: "heatcool",
|
climate.HVACMode.HEAT_COOL: "heatcool",
|
||||||
climate.HVAC_MODE_FAN_ONLY: "fan-only",
|
climate.HVACMode.FAN_ONLY: "fan-only",
|
||||||
climate.HVAC_MODE_DRY: "dry",
|
climate.HVACMode.DRY: "dry",
|
||||||
}
|
}
|
||||||
google_to_hvac = {value: key for key, value in hvac_to_google.items()}
|
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:
|
if current_humidity is not None:
|
||||||
response["thermostatHumidityAmbient"] = current_humidity
|
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:
|
if supported & climate.SUPPORT_TARGET_TEMPERATURE_RANGE:
|
||||||
response["thermostatTemperatureSetpointHigh"] = round(
|
response["thermostatTemperatureSetpointHigh"] = round(
|
||||||
temp_util.convert(
|
temp_util.convert(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user