From ae13b7853a2cddbb52f1be8f66bd9ac77b86690d Mon Sep 17 00:00:00 2001 From: Luke Prior <22492406+LukePrior@users.noreply.github.com> Date: Sat, 18 Sep 2021 13:12:32 +1000 Subject: [PATCH] Split temp & humidity SondeHub updates --- RX_FSK/RX_FSK.ino | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/RX_FSK/RX_FSK.ino b/RX_FSK/RX_FSK.ino index d3c87db..49dca2a 100644 --- a/RX_FSK/RX_FSK.ino +++ b/RX_FSK/RX_FSK.ino @@ -3488,12 +3488,20 @@ void sondehub_send_data(WiFiClient * client, SondeInfo * s, struct st_sondehub * w += strlen(w); } - // Only send temp & humidity if provided - if (((int)s->temperature != 0) && ((int)s->relativeHumidity != 0)) { + // Only send temp if provided + if ((int)s->temperature != 0) { + sprintf(w, + "\"temp\": %.3f,", + float(s->temperature) + ); + w += strlen(w); + } + + // Only send humidity if provided + if ((int)s->relativeHumidity != 0) { sprintf(w, - "\"temp\": %.3f," "\"humidity\": %.3f,", - float(s->temperature), float(s->relativeHumidity) + float(s->relativeHumidity) ); w += strlen(w); }