added description

This commit is contained in:
mischa 2019-11-06 11:13:00 +01:00
parent cd0be7d7ba
commit eb78856c45
1 changed files with 5 additions and 4 deletions

View File

@ -2,6 +2,7 @@
#
# Copyright 2019, Mischa Peters <mischa AT high5 DOT nl>, High5!.
# Version 1.0 - 20191028
# Version 1.1 - 20191106 - added battery status
#
# Get all sensor IDs (ZLLPresence, ZLLLightLevel and ZLLTemperature)
# grouped by ZLLPresence name
@ -58,9 +59,9 @@ for key in json_data:
for key in sensors:
for i in sensors[key]:
if json_data.get(i)['type'] == 'ZLLPresence':
print(json_data.get(i)['name'])
print(f"\t{i}: {json_data.get(i)['productname']}")
print(f"{json_data.get(i)['name']} ({json_data.get(i)['config']['battery']}%)")
print(f"{i:>5s}: {json_data.get(i)['productname']}")
if json_data.get(i)['type'] == 'ZLLLightLevel':
print(f"\t{i}: {json_data.get(i)['productname']}")
print(f"{i:>5s}: {json_data.get(i)['productname']}")
if json_data.get(i)['type'] == 'ZLLTemperature':
print(f"\t{i}: {json_data.get(i)['productname']}")
print(f"{i:>5s}: {json_data.get(i)['productname']}")