Forum Discussion
Anonymous
3 years agoSame. Although I used the SDK (references my custom lm library)
from lm import lm from pprint import pprint devices = lm.get_device_list(size=1000).to_dict()['items'] result = {} for d in devices: datasources = lm.get_device_datasource_list(d['id']).to_dict()['items'] for ds in datasources: # print(f"{d['display_name']}: {ds['data_source_display_name']} ({ds['instance_number']})") if d['display_name'] in result: result[d['display_name']] += ds['instance_number'] else: result[d['display_name']] = ds['instance_number'] for k,v in result.items(): print(f"{k}: {v}")
Related Content
- 7 months ago
- 8 months ago
- 5 months ago