From 9a225569fd39d8b9eeb61a381934a4f3f03f98ff Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 6 Jun 2026 15:06:32 +0200 Subject: [PATCH] formatting --- src/core/analogsensor.h | 8 +++--- src/core/emsdevicevalue.h | 56 ++++++++++++++++++------------------ src/core/network.cpp | 2 +- src/core/system.cpp | 12 ++++---- src/devices/thermostat.h | 2 +- src/web/WebStatusService.cpp | 4 +-- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/core/analogsensor.h b/src/core/analogsensor.h index 6492e2c8a..592452f96 100644 --- a/src/core/analogsensor.h +++ b/src/core/analogsensor.h @@ -174,10 +174,10 @@ class AnalogSensor { return sensors_.size(); } - bool update(uint8_t gpio, const char * name, double offset, double factor, uint8_t uom, int8_t type, bool deleted, bool is_system); - bool get_value_info(JsonObject output, const char * cmd, const int8_t id = -1); - void store_counters(); - std::string get_metrics_prometheus(); + bool update(uint8_t gpio, const char * name, double offset, double factor, uint8_t uom, int8_t type, bool deleted, bool is_system); + bool get_value_info(JsonObject output, const char * cmd, const int8_t id = -1); + void store_counters(); + std::string get_metrics_prometheus(); static const std::vector & exclude_types() { return exclude_types_; } diff --git a/src/core/emsdevicevalue.h b/src/core/emsdevicevalue.h index b7b1a016c..0eeaf4f62 100644 --- a/src/core/emsdevicevalue.h +++ b/src/core/emsdevicevalue.h @@ -49,34 +49,34 @@ class DeviceValue { // also used with HA as uom // shows also the HA device class being used enum DeviceValueUOM : uint8_t { - NONE = 0, // 0 - DEGREES, // 1 - °C - temperature - DEGREES_R, // 2 - °C (relative temperature) - temperature - PERCENT, // 3 - % - power factor - LMIN, // 4 - l/min - volume flow rate - KWH, // 5 - kWh - energy - WH, // 6 - Wh - energy - HOURS, // 7 - h - duration - MINUTES, // 8 - m - duration - UA, // 9 - µA - current - BAR, // 10 - bar - pressure - KW, // 11 - kW - power - W, // 12 - W - power - KB, // 13 - kB - data size - SECONDS, // 14 - s - duration - DBM, // 15 - dBm - signal strength - FAHRENHEIT, // 16 - °F - temperature - MV, // 17 - mV - voltage - SQM, // 18 - m² - area - M3, // 19 - m³ - volume - L, // 20 - L - volume - KMIN, // 21 - K*min - K, // 22 - K - temperature - VOLTS, // 23 - V - voltage - MBAR, // 24 - mbar - atmospheric pressure - LH, // 25 - l/h - volume flow rate - CTKWH, // 26 - ct/kWh - monetary - HERTZ, // 27 - Hz - frequency + NONE = 0, // 0 + DEGREES, // 1 - °C - temperature + DEGREES_R, // 2 - °C (relative temperature) - temperature + PERCENT, // 3 - % - power factor + LMIN, // 4 - l/min - volume flow rate + KWH, // 5 - kWh - energy + WH, // 6 - Wh - energy + HOURS, // 7 - h - duration + MINUTES, // 8 - m - duration + UA, // 9 - µA - current + BAR, // 10 - bar - pressure + KW, // 11 - kW - power + W, // 12 - W - power + KB, // 13 - kB - data size + SECONDS, // 14 - s - duration + DBM, // 15 - dBm - signal strength + FAHRENHEIT, // 16 - °F - temperature + MV, // 17 - mV - voltage + SQM, // 18 - m² - area + M3, // 19 - m³ - volume + L, // 20 - L - volume + KMIN, // 21 - K*min + K, // 22 - K - temperature + VOLTS, // 23 - V - voltage + MBAR, // 24 - mbar - atmospheric pressure + LH, // 25 - l/h - volume flow rate + CTKWH, // 26 - ct/kWh - monetary + HERTZ, // 27 - Hz - frequency CONNECTIVITY, // 28 - used in HA - connectivity TIMESTAMP, // 29 - used in HA - timestamp }; diff --git a/src/core/network.cpp b/src/core/network.cpp index 826d96ac1..90ae94d01 100644 --- a/src/core/network.cpp +++ b/src/core/network.cpp @@ -82,7 +82,7 @@ void Network::begin() { WiFi.persistent(false); WiFi.setAutoReconnect(false); WiFi.mode(WIFI_STA); - WiFi.disconnect(true, true); // wipe old settings in NVS + WiFi.disconnect(true, true); // wipe old settings in NVS WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); WiFi.setHostname(hostname_.c_str()); // updates shared default_hostname buffer WiFi.enableSTA(true); // creates the STA netif diff --git a/src/core/system.cpp b/src/core/system.cpp index b49b8b8fd..c26628fdf 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1532,8 +1532,8 @@ bool System::check_upgrade() { return StateUpdateResult::UNCHANGED; }); // Scheduler name is now mandatory, update FS - uint8_t i = 0; - bool schedule_changed = false; + uint8_t i = 0; + bool schedule_changed = false; EMSESP::webSchedulerService.update([&](WebScheduler & scheduler) { for (ScheduleItem & scheduleItem : scheduler.scheduleItems) { if (scheduleItem.name[0] == '\0') { @@ -2970,7 +2970,7 @@ bool System::uploadFirmwareURL(const char * url) { String scheme = saved_url.substring(0, 8); scheme.toLowerCase(); - const bool is_https = scheme.startsWith("https://"); + const bool is_https = scheme.startsWith("https://"); const int scheme_len = is_https ? 8 : 7; // "https://" vs "http://" WiFiClient basic_client; @@ -2992,11 +2992,11 @@ bool System::uploadFirmwareURL(const char * url) { ssl_client.setBufferSizes(16384, 1024); ssl_client.setSessionTimeout(120); } - basic_client.setTimeout(15000); // socket-level read timeout - ssl_client.setTimeout(15000); // Stream::readBytes timeout used by Update + basic_client.setTimeout(15000); // socket-level read timeout + ssl_client.setTimeout(15000); // Stream::readBytes timeout used by Update ssl_client.setClient(&basic_client, is_https); // enableSSL = false for plain HTTP - const uint16_t port = is_https ? 443 : 80; + const uint16_t port = is_https ? 443 : 80; String url_remain = saved_url.substring(scheme_len); int redirect_count = 0; diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 0ce01c51a..736af1eb1 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -304,7 +304,7 @@ class Thermostat : public EMSdevice { uint8_t instantstart; uint8_t coolstart; uint8_t coolondelay; - uint8_t cooloffdelay; + uint8_t cooloffdelay; // HybridHP uint8_t hybridStrategy_; // co2 = 1, cost = 2, temperature = 3, mix = 4 diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index 7966d04fc..81461379e 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -417,8 +417,8 @@ bool WebStatusService::refresh_versions_cache() { #else // detect scheme from EMSESP_VERSIONS_URL (case-insensitive). One code path for HTTP and HTTPS, // using ESP_SSLClient as a plain TCP passthrough when SSL is disabled. - String url = EMSESP_VERSIONS_URL; - String lower = url; + String url = EMSESP_VERSIONS_URL; + String lower = url; lower.toLowerCase(); const bool is_https = lower.startsWith("https://"); if (!is_https && !lower.startsWith("http://")) {