isInitialized() now also requires a valid sensor pointer, so plugin_read()
and plugin_write() never dereference a null sensor. setOutputValues() checks
it as well, and init() deletes a previous sensor object before allocating a
new one, so calling it again does not leak.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- handle_rules_edit(String, bool) is static now, but ESPEasy_WebServer.cpp
still called it for /rules/add, which no longer compiles:
"too many arguments to function 'bool handle_rules_edit(const String&)'"
Add handle_rules_add() in Rules.cpp and use that instead.
- Rules.cpp uses validIntFromString() without including Numerical.h
(this was already broken on mega when WEBSERVER_NEW_RULES is defined).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018S3oPMc7qQGQGGGyMUvcaf
Dallas_read_bit_ISR() and Dallas_write_bit_ISR() have only a single
caller, Dallas_read_bit() / Dallas_write_bit(), which is not in IRAM.
The ESP32 builds use LTO (-flto=auto, set by the build flags of the
arduino-esp32 framework package), so GCC inlines these functions into
their caller and the timing critical code with interrupts disabled runs
from flash. DALLAS_IRAM_ATTR thus had no effect for these functions.
Without LTO the same happens as soon as these functions are static
(-finline-functions-called-once is enabled at -Os).
Add noinline to DALLAS_IRAM_ATTR on ESP32.
ESP8266 is not affected, as DALLAS_IRAM_ATTR is empty there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018S3oPMc7qQGQGGGyMUvcaf
After splitting toNodeTypeDisplayString(), every node type which is not
ESP Easy, ESP Easy Mega, RPI Easy, Arduino Easy or Nano Easy was shown as
"ESP Easy 32". For example nodeType 0, the default of NodeStruct::nodeType.
Before, an empty string was returned for unknown node types.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018S3oPMc7qQGQGGGyMUvcaf
hideEscaped(), hideMasked() and restoreMaskedAndEscaped() are only used in
ESPEasyRules.cpp. With internal linkage GCC inlines them where they are
called once (builds without FEATURE_EXTENDED_STRING_FUNCTIONS), so the
ESP8266 build is the same size as before the previous commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parse_string_commands() had #else copies of hideEscaped(), hideMasked()
and restoreMaskedAndEscaped() for builds without
FEATURE_EXTENDED_STRING_FUNCTIONS, and the previous commit fixed a bug in
one of those copies. Build the helpers always and keep only the escaped
colon (\:) handling under FEATURE_EXTENDED_STRING_FUNCTIONS, the same as
in stripEscapeCharacters() / addEscapeCharacters().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In parse_string_commands() the branch without FEATURE_EXTENDED_STRING_FUNCTIONS
masked '{' and '}' in the whole line instead of in replacement (regression from
4e191fc5b). The following line.replace() put the unmasked braces back, so
get_next_inner_bracket() found them again and the loop never ended
(SW watchdog / exception reset). Mask replacement, as before 4e191fc5b.
Fixes #5653
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regression from #5369: P056_data_struct::ReadAverage() took float pm25/pm10 by value, so the averaged values never reached the caller and the task values stayed 0. Pass them by reference like CjkSDS011::ReadAverage().
writeToStreamDataBlock() waited for the rest of a body for as long as
connected() held. A server that stops sending part way through a body
without closing the connection leaves connected() true, so getString()
never returned and the unit stopped responding. Give up after
_tcpTimeout without data and return HTTPC_ERROR_READ_TIMEOUT, as
handleHeaderResponse() already does. Same fix as arendst/Tasmota#25139.
Avoid provisional NAN writes on valid reads because setFloat dispatches formulas. Use the invalid-value handler only after a failed register selection or short response. Add the requested GitHub changelog attribution.
OpenAI Codex automation prepared and validated this follow-up. The submitted plugin fails four new setter-order regression scenarios; all 12 revised host scenarios pass with ASan/UBSan. Both complete climate-A ESP8266/ESP32 firmware builds pass, retaining existing warnings in unchanged sources. No physical ESP board or HDC10xx sensor was tested.
`hostByName` does only return `1` on success, however it may return a negative value when lookup failed.
So need to check for the exact return value and not consider it a boolean return type.