Don't thow exception if connection to server is lost (#5775)
This commit is contained in:
parent
e5256ccf1f
commit
f3b9fa2f41
3 changed files with 5 additions and 3 deletions
|
@ -85,7 +85,9 @@ class TelldusLiveSensor(TelldusLiveEntity):
|
|||
@property
|
||||
def state(self):
|
||||
"""Return the state of the sensor."""
|
||||
if self._type == SENSOR_TYPE_TEMP:
|
||||
if not self.available:
|
||||
return None
|
||||
elif self._type == SENSOR_TYPE_TEMP:
|
||||
return self._value_as_temperature
|
||||
elif self._type == SENSOR_TYPE_HUMIDITY:
|
||||
return self._value_as_humidity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue