From f3b9fa2f4144a62fe53efe613f33fbff7eb88d56 Mon Sep 17 00:00:00 2001 From: Erik Eriksson Date: Thu, 9 Feb 2017 18:00:18 +0100 Subject: [PATCH] Don't thow exception if connection to server is lost (#5775) --- homeassistant/components/sensor/tellduslive.py | 4 +++- homeassistant/components/tellduslive.py | 2 +- requirements_all.txt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/sensor/tellduslive.py b/homeassistant/components/sensor/tellduslive.py index b7f3cf60892..9bebbe6e3dc 100644 --- a/homeassistant/components/sensor/tellduslive.py +++ b/homeassistant/components/sensor/tellduslive.py @@ -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 diff --git a/homeassistant/components/tellduslive.py b/homeassistant/components/tellduslive.py index 259d4e1becb..84ab96841d9 100644 --- a/homeassistant/components/tellduslive.py +++ b/homeassistant/components/tellduslive.py @@ -17,7 +17,7 @@ import voluptuous as vol DOMAIN = 'tellduslive' -REQUIREMENTS = ['tellduslive==0.3.0'] +REQUIREMENTS = ['tellduslive==0.3.2'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index 12aaaab9666..21c5538c76b 100755 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -645,7 +645,7 @@ steamodd==4.21 tellcore-py==1.1.2 # homeassistant.components.tellduslive -tellduslive==0.3.0 +tellduslive==0.3.2 # homeassistant.components.sensor.temper temperusb==1.5.1