From 04e65a6c5ff51f80e26dda6611bbbeb47be5c6c5 Mon Sep 17 00:00:00 2001 From: mischa Date: Wed, 6 Nov 2019 21:25:03 +0100 Subject: [PATCH] adding check for battery bug --- get-sensors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get-sensors.py b/get-sensors.py index 80880a9..bc10628 100644 --- a/get-sensors.py +++ b/get-sensors.py @@ -55,7 +55,7 @@ p = re.compile("([a-fA-F0-9]{2}:?){8}") sensors = collections.defaultdict(list); for key in json_data: - if "uniqueid" in json_data[key]: + if "uniqueid" in json_data[key] and json_data[key]['state']: if p.search(json_data[key]['uniqueid']): if json_data[key]['type'] == 'ZLLPresence': sensors[json_data[key]['uniqueid'][:-8]].insert(0, key)