diff --git a/CODEOWNERS b/CODEOWNERS index f6eeac33d8933cf6df38d18f863d97839bc56613..8ade44885400dd6bc8adbb46adc6389b511a8a3e 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -363,6 +363,7 @@ homeassistant/components/quantum_gateway/* @cisasteelersfan homeassistant/components/qvr_pro/* @oblogic7 homeassistant/components/qwikswitch/* @kellerza homeassistant/components/rachio/* @bdraco +homeassistant/components/radiotherm/* @vinnyfuria homeassistant/components/rainbird/* @konikvranik homeassistant/components/raincloud/* @vanstinator homeassistant/components/rainforest_eagle/* @gtdiehl @jcalbert diff --git a/homeassistant/components/radiotherm/climate.py b/homeassistant/components/radiotherm/climate.py index 4383cf97a2d023ff90929651db7124a62796d983..f09ef95170f68dcd864af6350a2176acf9e22072 100644 --- a/homeassistant/components/radiotherm/climate.py +++ b/homeassistant/components/radiotherm/climate.py @@ -1,5 +1,6 @@ """Support for Radio Thermostat wifi-enabled home thermostats.""" import logging +from socket import timeout import radiotherm import voluptuous as vol @@ -261,60 +262,60 @@ class RadioThermostat(ClimateEntity): # thermostats tend to time out sometimes when they're actively # heating or cooling. - # First time - get the name from the thermostat. This is - # normally set in the radio thermostat web app. - if self._name is None: - self._name = self.device.name["raw"] - - # Request the current state from the thermostat. try: + # First time - get the name from the thermostat. This is + # normally set in the radio thermostat web app. + if self._name is None: + self._name = self.device.name["raw"] + + # Request the current state from the thermostat. data = self.device.tstat["raw"] + + if self._is_model_ct80: + humiditydata = self.device.humidity["raw"] + except radiotherm.validate.RadiothermTstatError: _LOGGER.warning( "%s (%s) was busy (invalid value returned)", self._name, self.device.host, ) - return - current_temp = data["temp"] + except timeout: + _LOGGER.warning( + "Timeout waiting for response from %s (%s)", + self._name, + self.device.host, + ) - if self._is_model_ct80: - try: - humiditydata = self.device.humidity["raw"] - except radiotherm.validate.RadiothermTstatError: - _LOGGER.warning( - "%s (%s) was busy (invalid value returned)", - self._name, - self.device.host, - ) - return - self._current_humidity = humiditydata - self._program_mode = data["program_mode"] - self._preset_mode = CODE_TO_PRESET_MODE[data["program_mode"]] - - # Map thermostat values into various STATE_ flags. - self._current_temperature = current_temp - self._fmode = CODE_TO_FAN_MODE[data["fmode"]] - self._fstate = CODE_TO_FAN_STATE[data["fstate"]] - self._tmode = CODE_TO_TEMP_MODE[data["tmode"]] - self._tstate = CODE_TO_TEMP_STATE[data["tstate"]] - - self._current_operation = self._tmode - if self._tmode == HVAC_MODE_COOL: - self._target_temperature = data["t_cool"] - elif self._tmode == HVAC_MODE_HEAT: - self._target_temperature = data["t_heat"] - elif self._tmode == HVAC_MODE_AUTO: - # This doesn't really work - tstate is only set if the HVAC is - # active. If it's idle, we don't know what to do with the target - # temperature. - if self._tstate == CURRENT_HVAC_COOL: + else: + if self._is_model_ct80: + self._current_humidity = humiditydata + self._program_mode = data["program_mode"] + self._preset_mode = CODE_TO_PRESET_MODE[data["program_mode"]] + + # Map thermostat values into various STATE_ flags. + self._current_temperature = data["temp"] + self._fmode = CODE_TO_FAN_MODE[data["fmode"]] + self._fstate = CODE_TO_FAN_STATE[data["fstate"]] + self._tmode = CODE_TO_TEMP_MODE[data["tmode"]] + self._tstate = CODE_TO_TEMP_STATE[data["tstate"]] + + self._current_operation = self._tmode + if self._tmode == HVAC_MODE_COOL: self._target_temperature = data["t_cool"] - elif self._tstate == CURRENT_HVAC_HEAT: + elif self._tmode == HVAC_MODE_HEAT: self._target_temperature = data["t_heat"] - else: - self._current_operation = HVAC_MODE_OFF + elif self._tmode == HVAC_MODE_AUTO: + # This doesn't really work - tstate is only set if the HVAC is + # active. If it's idle, we don't know what to do with the target + # temperature. + if self._tstate == CURRENT_HVAC_COOL: + self._target_temperature = data["t_cool"] + elif self._tstate == CURRENT_HVAC_HEAT: + self._target_temperature = data["t_heat"] + else: + self._current_operation = HVAC_MODE_OFF def set_temperature(self, **kwargs): """Set new target temperature.""" diff --git a/homeassistant/components/radiotherm/manifest.json b/homeassistant/components/radiotherm/manifest.json index 6d4567c59d660a6f75fe1d5aac4a7de7a604b731..0220c2338419dcfb230e6f827f3be933dab18c9a 100644 --- a/homeassistant/components/radiotherm/manifest.json +++ b/homeassistant/components/radiotherm/manifest.json @@ -2,6 +2,6 @@ "domain": "radiotherm", "name": "Radio Thermostat", "documentation": "https://www.home-assistant.io/integrations/radiotherm", - "requirements": ["radiotherm==2.0.0"], - "codeowners": [] + "requirements": ["radiotherm==2.1.0"], + "codeowners": ["@vinnyfuria"] } diff --git a/requirements_all.txt b/requirements_all.txt index d0fdc3f8a30ab3b4d9584d7f9d4f084a7bb4d4e4..c55f9adedb905f576a3807837dd25955aee6762b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1913,7 +1913,7 @@ quantum-gateway==0.0.5 rachiopy==1.0.3 # homeassistant.components.radiotherm -radiotherm==2.0.0 +radiotherm==2.1.0 # homeassistant.components.raincloud raincloudy==0.0.7