diff --git a/interface/src/app/main/OptionIcon.tsx b/interface/src/app/main/OptionIcon.tsx index 9cb094e19..6b9fa5bc1 100644 --- a/interface/src/app/main/OptionIcon.tsx +++ b/interface/src/app/main/OptionIcon.tsx @@ -13,11 +13,7 @@ import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined'; import type { SvgIconProps } from '@mui/material'; export type OptionType = - | 'deleted' - | 'readonly' - | 'web_exclude' - | 'api_mqtt_exclude' - | 'favorite'; + 'deleted' | 'readonly' | 'web_exclude' | 'api_mqtt_exclude' | 'favorite'; type IconPair = [ React.ComponentType, diff --git a/src/core/analogsensor.h b/src/core/analogsensor.h index 31a7af0ec..94da0653b 100644 --- a/src/core/analogsensor.h +++ b/src/core/analogsensor.h @@ -207,12 +207,12 @@ class AnalogSensor { uint32_t sensorreads_ = 0; #ifndef EMSESP_STANDALONE - static void IRAM_ATTR freqIrq0(); - static void IRAM_ATTR freqIrq1(); - static void IRAM_ATTR freqIrq2(); + static void IRAM_ATTR freqIrq0(); + static void IRAM_ATTR freqIrq1(); + static void IRAM_ATTR freqIrq2(); static volatile unsigned long edge[3]; // written from freqIrqN() ISRs, read from the main measure() loop (partly outside the critical section) static volatile unsigned long edgecnt[3]; // written from freqIrqN() ISRs, read from the main measure() loop (partly outside the critical section) - unsigned long lastedge[3] = {0, 0, 0}; + unsigned long lastedge[3] = {0, 0, 0}; #endif }; diff --git a/src/core/command.cpp b/src/core/command.cpp index a0e9f41c6..d0985dd36 100644 --- a/src/core/command.cpp +++ b/src/core/command.cpp @@ -381,8 +381,8 @@ uint8_t Command::call(const uint8_t device_type, const char * command, const cha // for the Commands device, calling a named command executes it (using its stored value) // rather than returning its definition, so skip the value-info lookup and fall through // to the registered command function. The list keywords above are still handled. - bool is_named_command = (device_type == EMSdevice::DeviceType::COMMAND) && strcmp(cmd, F_(info)) && strcmp(cmd, F_(values)) - && strcmp(cmd, F_(entities)) && strcmp(cmd, F_(metrics)); + bool is_named_command = (device_type == EMSdevice::DeviceType::COMMAND) && strcmp(cmd, F_(info)) && strcmp(cmd, F_(values)) && strcmp(cmd, F_(entities)) + && strcmp(cmd, F_(metrics)); if (!is_named_command && EMSESP::get_device_value_info(output, cmd, id, device_type)) { // entity = cmd LOG_DEBUG("Fetched device entity/attributes for %s/%s (id=%d)", dname, cmd, id); return CommandRet::OK; diff --git a/src/core/command.h b/src/core/command.h index f66111ecb..9c7cb50e1 100644 --- a/src/core/command.h +++ b/src/core/command.h @@ -59,7 +59,7 @@ using cmd_function_p = std::function'); - bool has_min = (min_pos != std::string::npos); - uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0; + const auto & cf = custom_fullname(); + auto min_pos = cf.find('>'); + bool has_min = (min_pos != std::string::npos); + uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0; if (has_min) { int32_t v = Helpers::atoint(cf.substr(min_pos + 1).c_str()); if (fahrenheit) { @@ -370,10 +370,10 @@ bool DeviceValue::get_custom_min(int16_t & val) { // extract custom max from custom_fullname bool DeviceValue::get_custom_max(uint32_t & val) { - const auto & cf = custom_fullname(); - auto max_pos = cf.find('<'); - bool has_max = (max_pos != std::string::npos); - uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0; + const auto & cf = custom_fullname(); + auto max_pos = cf.find('<'); + bool has_max = (max_pos != std::string::npos); + uint8_t fahrenheit = !EMSESP::system_.fahrenheit() ? 0 : (uom == DeviceValueUOM::DEGREES) ? 2 : (uom == DeviceValueUOM::DEGREES_R) ? 1 : 0; if (has_max) { int32_t v = Helpers::atoint(cf.substr(max_pos + 1).c_str()); if (fahrenheit) { diff --git a/src/core/emsesp.cpp b/src/core/emsesp.cpp index feb747586..9c75566bc 100644 --- a/src/core/emsesp.cpp +++ b/src/core/emsesp.cpp @@ -1884,16 +1884,16 @@ void EMSESP::loop() { if (EMSESP::system_.systemStatus() != SYSTEM_STATUS::SYSTEM_STATUS_PENDING_UPLOAD && EMSESP::system_.systemStatus() != SYSTEM_STATUS::SYSTEM_STATUS_UPLOADING) { // loop through the services - webStatusService.loop(); // periodic refresh of cached versions.json - rxservice_.loop(); // process any incoming Rx telegrams - shower_.loop(); // check for shower on/off - temperaturesensor_.loop(); // read sensor temperatures - analogsensor_.loop(); // read analog sensor values - publish_all_loop(); // with HA messages in parts to avoid flooding the MQTT queue - mqtt_.loop(); // sends out anything in the MQTT queue - webModulesService.loop(); // loop through the external library modules - webSchedulerService.loop(); // scheduler timing logic; command execution is offloaded to WebCommandService's worker task - scheduled_fetch_values(); // force a query on the EMS devices to fetch latest data at a set interval (1 min) + webStatusService.loop(); // periodic refresh of cached versions.json + rxservice_.loop(); // process any incoming Rx telegrams + shower_.loop(); // check for shower on/off + temperaturesensor_.loop(); // read sensor temperatures + analogsensor_.loop(); // read analog sensor values + publish_all_loop(); // with HA messages in parts to avoid flooding the MQTT queue + mqtt_.loop(); // sends out anything in the MQTT queue + webModulesService.loop(); // loop through the external library modules + webSchedulerService.loop(); // scheduler timing logic; command execution is offloaded to WebCommandService's worker task + scheduled_fetch_values(); // force a query on the EMS devices to fetch latest data at a set interval (1 min) compact_entities_if_stable(); // reclaim over-reserved entity vector capacity once device discovery settles } // check for GPIO Errors - this is called once when booting diff --git a/src/web/WebCommandService.h b/src/web/WebCommandService.h index 4077a39cf..41ef54f67 100644 --- a/src/web/WebCommandService.h +++ b/src/web/WebCommandService.h @@ -83,8 +83,8 @@ class WebCommandService : public StatefulService { bool queueCommand(const char * name, const char * value = nullptr); bool dispatchCommand(const char * name, const char * value = nullptr); - static bool isUrlCommand(const std::string & command); // true if the command definition is a HTTP/URL command - static bool valueContainsUrl(const std::string & value); // true if a value embeds a {"url":...} compute() will fetch + static bool isUrlCommand(const std::string & command); // true if the command definition is a HTTP/URL command + static bool valueContainsUrl(const std::string & value); // true if a value embeds a {"url":...} compute() will fetch const CommandItem * find(const char * name);