Add device metrics uptime to MQTT JSON (#3643)

* Add device metrics uptime to MQTT JSON

* Cast a spell
This commit is contained in:
Ben Meadors 2024-04-17 07:00:18 -05:00 committed by GitHub
parent c34956e9d8
commit 2450031b1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -656,6 +656,7 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
msgPayload["voltage"] = new JSONValue(decoded->variant.device_metrics.voltage);
msgPayload["channel_utilization"] = new JSONValue(decoded->variant.device_metrics.channel_utilization);
msgPayload["air_util_tx"] = new JSONValue(decoded->variant.device_metrics.air_util_tx);
msgPayload["uptime_seconds"] = new JSONValue((uint)decoded->variant.device_metrics.uptime_seconds);
} else if (decoded->which_variant == meshtastic_Telemetry_environment_metrics_tag) {
msgPayload["temperature"] = new JSONValue(decoded->variant.environment_metrics.temperature);
msgPayload["relative_humidity"] = new JSONValue(decoded->variant.environment_metrics.relative_humidity);