From ade62faa381dbd5bfcb25a1a70c8ecfdc043b1e6 Mon Sep 17 00:00:00 2001 From: Erik Eriksson Date: Thu, 10 Nov 2016 17:46:32 +0100 Subject: [PATCH] Don't fail if component name is None. Fixes (#4334) https://github.com/home-assistant/home-assistant/issues/4326 Might fix https://github.com/home-assistant/home-assistant/issues/4326 --- homeassistant/components/tellduslive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/tellduslive.py b/homeassistant/components/tellduslive.py index 961e4edd891..105c5323e83 100644 --- a/homeassistant/components/tellduslive.py +++ b/homeassistant/components/tellduslive.py @@ -77,7 +77,7 @@ def request_sensors(): units = NETWORK.request('sensors/list') # One unit can contain many sensors. if units and 'sensor' in units: - return {unit['id']+sensor['name']: dict(unit, data=sensor) + return {unit['id']+str(sensor['name']): dict(unit, data=sensor) for unit in units['sensor'] for sensor in unit['data']} return None @@ -117,7 +117,7 @@ class TelldusLiveData(object): def _discover(self, found_devices, component_name): """Send discovery event if component not yet discovered.""" - if not len(found_devices): + if not found_devices: return _LOGGER.info("discovered %d new %s devices",