skip ZGPSwitch
This commit is contained in:
parent
7378e680ba
commit
4348738b20
|
@ -28,7 +28,6 @@ parser.add_argument("bridge", type=str, help="Hue Bridge IP")
|
|||
parser.add_argument("token", type=str, help="Hue API Token")
|
||||
parser.add_argument("-b", "--battery", type=int, help="battery check only, threshold, default 20")
|
||||
parser.add_argument("-v", "--verbose", action='store_true', help="verbose")
|
||||
parser.add_argument("-d", "--debug", action='store_true', help="debug")
|
||||
|
||||
try:
|
||||
args = parser.parse_args()
|
||||
|
@ -36,7 +35,6 @@ try:
|
|||
token = args.token
|
||||
battery = args.battery
|
||||
verbose = args.verbose
|
||||
debug = args.debug
|
||||
|
||||
except argparse.ArgumentError as e:
|
||||
print(str(e))
|
||||
|
@ -59,6 +57,9 @@ for key in json_data:
|
|||
if p.search(json_data[key]['uniqueid']):
|
||||
if json_data[key]['type'] == 'ZLLPresence':
|
||||
sensors[json_data[key]['uniqueid'][:-8]].insert(0, key)
|
||||
elif json_data[key]['type'] == 'ZGPSwitch':
|
||||
# Don't add ZGPSwitch, doesn't have a battery component
|
||||
continue
|
||||
else:
|
||||
sensors[json_data[key]['uniqueid'][:-8]].append(key)
|
||||
|
||||
|
@ -74,7 +75,7 @@ for key in sensors:
|
|||
print(f"{i:>5s}: {json_data.get(i)['productname']}")
|
||||
else:
|
||||
if not "battery" in json_data.get(i)['config']:
|
||||
print(f"ID Failing: {i}")
|
||||
print(f"Sensor without battery property found: {i}")
|
||||
print(json.dumps(json_data.get(i), indent=4, sort_keys=True))
|
||||
quit()
|
||||
if int(json_data.get(i)['config']['battery']) < battery:
|
||||
|
|
Loading…
Reference in New Issue