From 79e407c2068833534ec8182c8021590645589f26 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Tue, 26 Oct 2021 20:55:42 -0400 Subject: [PATCH] acurite 606tx update --- bin/user/sdr.py | 9 +++++++-- changelog | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/user/sdr.py b/bin/user/sdr.py index a737e08..709710c 100644 --- a/bin/user/sdr.py +++ b/bin/user/sdr.py @@ -705,8 +705,10 @@ def get_rain_total(obj): class Acurite606TXPacket(Packet): # 2017-03-20: Acurite 606TX Temperature Sensor # {"time" : "2017-03-04 16:18:12", "model" : "Acurite 606TX Sensor", "id" : 48, "battery" : "OK", "temperature_C" : -1.100} + # {"time" : "2021-10-26 23:39:49", "model" : "Acurite-606TX", "id" : 194, "battery_ok" : 1, "temperature_C" : 19.200, "mic" : "CHECKSUM"} - IDENTIFIER = "Acurite 606TX Sensor" +# IDENTIFIER = "Acurite 606TX Sensor" + IDENTIFIER = "Acurite-606TX" @staticmethod def parse_json(obj): @@ -715,7 +717,10 @@ def parse_json(obj): pkt['usUnits'] = weewx.METRIC sensor_id = obj.get('id') pkt['temperature'] = Packet.get_float(obj, 'temperature_C') - pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 + if 'battery' in obj: + pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 + if 'battery_ok' in obj: + pkt['battery'] = 0 if Packet.get_int(obj, 'battery_ok') == 1 else 1 pkt = Packet.add_identifiers(pkt, sensor_id, Acurite606TXPacket.__name__) return pkt diff --git a/changelog b/changelog index 0171990..f3a3244 100644 --- a/changelog +++ b/changelog @@ -3,6 +3,7 @@ * fix bresser 6in1 indentation * use introspection for packet listing - packet must have IDENTIFIER * provide more feedback when listing recognized packet types +* update identifier and fields for Acurite 606TX 0.82 26oct2021 * huge thanks to andylittle for rolling up many changes while i was unavailable