meshtastic_mqtt

- Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.acid.vegas/-c.git
Log | Files | Refs | Archive | README | LICENSE

commit 54c05910531be4ff5e20c2e05d94bcc1ca54fc68
parent b4104b9833227984a6cf732968433f9c1ed611cd
Author: acidvegas <acid.vegas@acid.vegas>
Date: Tue, 31 Dec 2024 18:17:01 -0500

Fixed NaN errors with telemetry messages

Diffstat:
Msrc/meshtastic_mqtt_json/client.py | 3++-

1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/meshtastic_mqtt_json/client.py b/src/meshtastic_mqtt_json/client.py
@@ -292,7 +292,8 @@ class MeshtasticMQTT(object):
 			elif mp.decoded.portnum == portnums_pb2.TELEMETRY_APP:
 				telemetry = telemetry_pb2.Telemetry()
 				telemetry.ParseFromString(mp.decoded.payload)
-				json_packet['decoded']['payload'] = json.loads(MessageToJson(telemetry))
+				telemetry_json = json.loads(MessageToJson(telemetry))
+				json_packet['decoded']['payload'] = replace_nan(telemetry_json)
 				print(json.dumps(json_packet))
 
 			elif mp.decoded.portnum == portnums_pb2.TEXT_MESSAGE_APP: