From 89ec752064709358e2e49c6a51c39841a09da5e8 Mon Sep 17 00:00:00 2001 From: Erik Eriksson Date: Tue, 31 Jan 2017 20:08:11 +0100 Subject: [PATCH] Upgraded tellduslive (#5664) --- homeassistant/components/sensor/tellduslive.py | 2 +- homeassistant/components/tellduslive.py | 13 ++++++------- requirements_all.txt | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/sensor/tellduslive.py b/homeassistant/components/sensor/tellduslive.py index abc5843ad91..b7f3cf60892 100644 --- a/homeassistant/components/sensor/tellduslive.py +++ b/homeassistant/components/sensor/tellduslive.py @@ -58,7 +58,7 @@ class TelldusLiveSensor(TelldusLiveEntity): @property def _value(self): """Return value of the sensor.""" - return self.device.value(self._id[1:]) + return self.device.value(*self._id[1:]) @property def _value_as_temperature(self): diff --git a/homeassistant/components/tellduslive.py b/homeassistant/components/tellduslive.py index b470ae7daec..259d4e1becb 100644 --- a/homeassistant/components/tellduslive.py +++ b/homeassistant/components/tellduslive.py @@ -17,7 +17,7 @@ import voluptuous as vol DOMAIN = 'tellduslive' -REQUIREMENTS = ['tellduslive==0.1.13'] +REQUIREMENTS = ['tellduslive==0.3.0'] _LOGGER = logging.getLogger(__name__) @@ -133,8 +133,8 @@ class TelldusLiveClient(object): if device.device_id in known_ids: continue if device.is_sensor: - for item_id in device.items: - discover((device.device_id,) + item_id, + for item in device.items: + discover((device.device_id, item.name, item.scale), 'sensor') else: discover(device.device_id, @@ -145,8 +145,7 @@ class TelldusLiveClient(object): def device(self, device_id): """Return device representation.""" - import tellduslive - return tellduslive.Device(self._client, device_id) + return self._client.device(device_id) def is_available(self, device_id): """Return device availability.""" @@ -221,5 +220,5 @@ class TelldusLiveEntity(Entity): @property def _last_updated(self): """Return the last update of a device.""" - return str(datetime.fromtimestamp(self.device.last_updated)) \ - if self.device.last_updated else None + return str(datetime.fromtimestamp(self.device.lastUpdated)) \ + if self.device.lastUpdated else None diff --git a/requirements_all.txt b/requirements_all.txt index c80f0c79f79..bdf099aece6 100755 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -620,7 +620,7 @@ steamodd==4.21 tellcore-py==1.1.2 # homeassistant.components.tellduslive -tellduslive==0.1.13 +tellduslive==0.3.0 # homeassistant.components.sensor.temper temperusb==1.5.1