Fix for radiotherm component stall (#45482)

This commit is contained in:
Vinny Furia 2021-01-24 16:01:41 -07:00 committed by GitHub
parent 12e31b9571
commit 34f701a69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 46 deletions

View File

@ -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

View File

@ -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,40 +262,40 @@ class RadioThermostat(ClimateEntity):
# thermostats tend to time out sometimes when they're actively
# heating or cooling.
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.
try:
data = self.device.tstat["raw"]
except radiotherm.validate.RadiothermTstatError:
_LOGGER.warning(
"%s (%s) was busy (invalid value returned)",
self._name,
self.device.host,
)
return
current_temp = data["temp"]
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
except timeout:
_LOGGER.warning(
"Timeout waiting for response from %s (%s)",
self._name,
self.device.host,
)
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 = current_temp
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"]]

View File

@ -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"]
}

View File

@ -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