mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
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
@ -77,7 +77,7 @@ def request_sensors():
|
|||||||
units = NETWORK.request('sensors/list')
|
units = NETWORK.request('sensors/list')
|
||||||
# One unit can contain many sensors.
|
# One unit can contain many sensors.
|
||||||
if units and 'sensor' in units:
|
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 unit in units['sensor']
|
||||||
for sensor in unit['data']}
|
for sensor in unit['data']}
|
||||||
return None
|
return None
|
||||||
@ -117,7 +117,7 @@ class TelldusLiveData(object):
|
|||||||
|
|
||||||
def _discover(self, found_devices, component_name):
|
def _discover(self, found_devices, component_name):
|
||||||
"""Send discovery event if component not yet discovered."""
|
"""Send discovery event if component not yet discovered."""
|
||||||
if not len(found_devices):
|
if not found_devices:
|
||||||
return
|
return
|
||||||
|
|
||||||
_LOGGER.info("discovered %d new %s devices",
|
_LOGGER.info("discovered %d new %s devices",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user