From a9f0b0dea222852bd7c33a423db0b736a5ab8cb6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 12 Nov 2016 17:52:29 +0100 Subject: [PATCH] Convert payload byte1 to int --- python/adeunisrf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/adeunisrf.py b/python/adeunisrf.py index 100cb28..ee4307f 100644 --- a/python/adeunisrf.py +++ b/python/adeunisrf.py @@ -26,7 +26,7 @@ known_devices = [ "0018B20000000C58", "0018B20000000C37", "0018B20000000C59", "0 def get_gps(deveui, payload): res = [] - if not payload[0] & (2**7): + if not int(payload[0:2], 16) & (2**7): return res lat_deg = float(payload[4:6]) @@ -49,7 +49,8 @@ def get_gps(deveui, payload): def get_temp(deveui, payload): res = [] - if payload[0] & (2**7): + + if int(payload[0:2], 16) & (2**7): res = [ deveui + ":temperature=" + str(binascii.a2b_hex(payload)[1])] return res