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
This commit is contained in:
parent
ee322dbbdc
commit
ade62faa38
1 changed files with 2 additions and 2 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue