From f08c2e4fea8547b0a8a42a1bb148d37c8c1e21c5 Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Sat, 20 Apr 2024 11:51:51 -0400 Subject: [PATCH] Update thermostat enum (#562) * Update climate.py * update imports --- custom_components/wyzeapi/climate.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/custom_components/wyzeapi/climate.py b/custom_components/wyzeapi/climate.py index 213a5831..88b36376 100644 --- a/custom_components/wyzeapi/climate.py +++ b/custom_components/wyzeapi/climate.py @@ -22,7 +22,7 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import device_registry as dr from wyzeapy import Wyzeapy, ThermostatService -from wyzeapy.services.thermostat_service import Thermostat, TemperatureUnit, HVACMode, Preset, FanMode, HVACState +from wyzeapy.services.thermostat_service import Thermostat, TemperatureUnit, Preset, FanMode, HVACState, HVACMode as WyzeHVACMode from .token_manager import token_exception_handler from .const import DOMAIN, CONF_CLIENT @@ -113,11 +113,11 @@ def unit_of_measurement(self) -> str: @property def hvac_mode(self) -> str: # pylint: disable=R1705 - if self._thermostat.hvac_mode == HVACMode.AUTO: + if self._thermostat.hvac_mode == WyzeHVACMode.AUTO: return HVACMode.AUTO - elif self._thermostat.hvac_mode == HVACMode.HEAT: + elif self._thermostat.hvac_mode == WyzeHVACMode.HEAT: return HVACMode.HEAT - elif self._thermostat.hvac_mode == HVACMode.COOL: + elif self._thermostat.hvac_mode == WyzeHVACMode.COOL: return HVACMode.COOL else: return HVACMode.OFF @@ -218,16 +218,16 @@ async def async_set_fan_mode(self, fan_mode: str) -> None: @token_exception_handler async def async_set_hvac_mode(self, hvac_mode: str) -> None: if hvac_mode == HVACMode.OFF: - await self._thermostat_service.set_hvac_mode(self._thermostat, HVACMode.OFF) + await self._thermostat_service.set_hvac_mode(self._thermostat, WyzeHVACMode.OFF) self._thermostat.hvac_mode = HVACMode.OFF elif hvac_mode == HVACMode.HEAT: - await self._thermostat_service.set_hvac_mode(self._thermostat, HVACMode.HEAT) + await self._thermostat_service.set_hvac_mode(self._thermostat, WyzeHVACMode.HEAT) self._thermostat.hvac_mode = HVACMode.HEAT elif hvac_mode == HVACMode.COOL: - await self._thermostat_service.set_hvac_mode(self._thermostat, HVACMode.COOL) + await self._thermostat_service.set_hvac_mode(self._thermostat, WyzeHVACMode.COOL) self._thermostat.hvac_mode = HVACMode.COOL elif hvac_mode == HVACMode.AUTO: - await self._thermostat_service.set_hvac_mode(self._thermostat, HVACMode.AUTO) + await self._thermostat_service.set_hvac_mode(self._thermostat, WyzeHVACMode.AUTO) self._thermostat.hvac_mode = HVACMode.AUTO self._server_out_of_sync = True