From 9256e7611f6814ec76c064af859397c4df37e2ce Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Sat, 23 Dec 2023 08:02:44 +0100 Subject: [PATCH] Code indention fixes --- firmware/constants.h | 1 - firmware/firmware.ino | 57 ++++++++++++++++++++++--------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/firmware/constants.h b/firmware/constants.h index aea0fe1..e9d2d27 100644 --- a/firmware/constants.h +++ b/firmware/constants.h @@ -11,7 +11,6 @@ #define SENSOR_ESAVEMODE 6 #define SENSOR_BATCHARGESTATE 7 - #define BAT_CHARGE_STATE_CHARGED 2.0 #define BAT_CHARGE_STATE_CHARGING 1.0 #define BAT_CHARGE_STATE_NOTCHARGING 0.0 diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 8718c74..02fce62 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -26,7 +26,7 @@ #ifdef HTTP_CALL_SEND_JSON_DATA #include -#include // from bib manager UrlEncode by Masayuki +#include // from bib manager UrlEncode 1.0.0 by Masayuki #endif //*************************************************************************// @@ -44,7 +44,8 @@ const uint8_t VALUES = 8; // see constants.h file - count of number of SENSOR_ defines float currentSensorData[VALUES] = { nanf("no value"), nanf("no value"), nanf("no value"), nanf("no value"), nanf("no value"), nanf("no value"), - nanf("no value"), nanf("no value") }; + nanf("no value"), nanf("no value") + }; uint32_t update_sensor_cnt = 0; uint32_t update_webserver_cnt = 0; @@ -290,7 +291,7 @@ void wifiConnectionCheck() { #ifdef ENABLE_PING_HOST_TEST debug("Ping " + String(PING_HOST_IP)); success = Ping.ping(PING_HOST_IP, 3); - + if (success) { debug("Ping success"); @@ -756,30 +757,30 @@ String getJsonData() { debug(String(SENSOR_TEMPERATURE) + "=" + String(currentSensorData[SENSOR_TEMPERATURE])); String msg = hb_ws_msg_start + - hb_ws_msg_temp + - String(currentSensorData[SENSOR_TEMPERATURE], 2) + - ", " + - hb_ws_msg_humi + - 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 - ", " + - hb_ws_msg_windspeed + - String(currentSensorData[SENSOR_WINDSPEED], 2) + - ", " + - hb_ws_msg_pressure + - String(currentSensorData[SENSOR_PRESSURE], 2) + - ", " + - hb_ws_msg_voltage + - String(currentSensorData[SENSOR_VOLTAGE], 2) + - ", " + - hb_ws_msg_timestamp + - String(millis()) + - ", " + - hb_ws_msg_valid + - String(validData) + - hb_ws_msg_end; + hb_ws_msg_temp + + String(currentSensorData[SENSOR_TEMPERATURE], 2) + + ", " + + hb_ws_msg_humi + + 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 + ", " + + hb_ws_msg_windspeed + + String(currentSensorData[SENSOR_WINDSPEED], 2) + + ", " + + hb_ws_msg_pressure + + String(currentSensorData[SENSOR_PRESSURE], 2) + + ", " + + hb_ws_msg_voltage + + String(currentSensorData[SENSOR_VOLTAGE], 2) + + ", " + + hb_ws_msg_timestamp + + String(millis()) + + ", " + + hb_ws_msg_valid + + String(validData) + + hb_ws_msg_end; return msg; } @@ -810,7 +811,7 @@ void http_call_send_json_data() String response = http.getString(); debug("http response code: " + String(httpResponseCode) + " = " + response); - + http.end(); digitalWrite(STATUS_LED_PIN, HIGH);