From baff93865c8a79f751d258dfc7f7ade1417c8092 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Fri, 11 Nov 2022 11:23:08 +0100 Subject: [PATCH] Added fix to prevent sending nan value through http get to the destination webserver. --- firmware/firmware.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/firmware.ino b/firmware/firmware.ino index ea0119c..01133d4 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -688,7 +688,7 @@ String getJsonData() String(currentSensorData[SENSOR_TEMPERATURE], 2) + ", " + hb_ws_msg_humi + - String(currentSensorData[SENSOR_HUMIDITY], 2) + + String( (isnan(currentSensorData[SENSOR_HUMIDITY]) ? 0.0 : currentSensorData[SENSOR_HUMIDITY]), 2) + ", " + hb_ws_msg_light + String(currentSensorData[SENSOR_LIGHT], 0) + // The light level for the homebridge-http-lux2 plugin is only able to parse integer values @@ -713,7 +713,7 @@ void http_call_send_json_data() { currentSensorData[sensor_cnt] = measure_wind_result(); - debug("http call to " + String(currentSensorData[sensor_cnt])); + //debug("http call to " + String(HTTP_CALL_SEND_JSON_DATA_URL)); // windspeed exceeded send http call digitalWrite(STATUS_LED_PIN, LOW);