J. Nick Koston
1d582c4e01
Merge remote-tracking branch 'upstream/templatable-value-specialize' into integration
2026-04-07 14:39:38 -10:00
J. Nick Koston
4cc6624cb0
[core] Emit deprecation warning on TemplatableFn return type mismatch
2026-04-07 14:37:54 -10:00
J. Nick Koston
05011a28a0
[core] Support convertible return types in TemplatableFn via trampoline
...
TemplatableFn now accepts stateless lambdas whose return type is
convertible to T (e.g., int -> uint8_t). Uses a casting trampoline
that reconstructs the stateless lambda via F{} (default-constructible
in C++20).
Also:
- Remove std::move on trivially copyable TemplatableFn (clang-tidy)
- Wrap http_request method via cg.templatable()
2026-04-07 14:35:22 -10:00
J. Nick Koston
d277dc5ae9
[lvgl][sensor] Remove std::move on trivially copyable TemplatableFn
...
clang-tidy flags std::move on trivially copyable types as no-op.
TemplatableFn is a single function pointer — copy is equivalent.
2026-04-07 14:33:04 -10:00
J. Nick Koston
11c24324d5
Merge remote-tracking branch 'upstream/templatable-value-specialize' into integration
2026-04-07 14:31:35 -10:00
J. Nick Koston
7d497e6b52
Merge remote-tracking branch 'upstream/dev' into integration
2026-04-07 14:31:13 -10:00
J. Nick Koston
a3dec4053d
[http_request] Wrap method constant via cg.templatable for TemplatableFn
2026-04-07 14:23:10 -10:00
J. Nick Koston
89bd529cf9
[mdns] Add comment explaining why manual lambda wrapping is needed
2026-04-07 14:18:32 -10:00
J. Nick Koston
6d0c61dc73
[core] Use TemplatableStorage alias to select TemplatableFn or TemplatableValue
...
TEMPLATABLE_VALUE macro now uses TemplatableStorage<T, Ts...> which
selects TemplatableFn for non-string types (4 bytes) and
TemplatableValue for std::string (full PROGMEM/FlashStringHelper support).
Fixes ESP8266 compile failure where __FlashStringHelper* couldn't
assign to TemplatableFn<std::string>.
2026-04-07 14:17:41 -10:00
J. Nick Koston
0dddeea4d2
[core] Assert stateless capture in test, fix TemplatableFn comment
2026-04-07 14:10:18 -10:00
J. Nick Koston
8f6acbd42d
[core] Add const to string specialization optional_value/value_or
2026-04-07 14:04:00 -10:00
J. Nick Koston
779faec9a5
[mdns] Move LambdaExpression import to top level
2026-04-07 13:57:10 -10:00
J. Nick Koston
29a6361df3
[mdns] Wrap raw port values in lambda in mdns_service() public API
2026-04-07 13:56:46 -10:00
J. Nick Koston
d0754d1466
[core] Fix TemplatableValue move: destroy moved-from value for non-trivial T
2026-04-07 13:55:12 -10:00
J. Nick Koston
11934ab27f
[sensor] Wrap benchmark filter constants in lambdas for TemplatableFn
2026-04-07 13:49:55 -10:00
Jesse Hills
b307c7c74c
[config_validation] Add unbounded percentage validators ( #15500 )
2026-04-08 11:44:52 +12:00
J. Nick Koston
4f4f256ab3
convert a few more
2026-04-07 13:44:23 -10:00
J. Nick Koston
be8449a39a
convert a few more
2026-04-07 13:43:13 -10:00
J. Nick Koston
d78a3ab41b
convert a few more
2026-04-07 13:42:35 -10:00
J. Nick Koston
b53b6e9218
convert a few more
2026-04-07 13:42:29 -10:00
J. Nick Koston
a9e9064aa3
convert a few more
2026-04-07 13:42:00 -10:00
J. Nick Koston
03677db79a
[core] Add TemplatableFn and TemplatableValue (value+fn) dual storage
...
- TemplatableFn<T, X...>: 4-byte function-pointer-only storage, used by
TEMPLATABLE_VALUE macro for codegen-managed fields
- TemplatableValue<T, X...>: 8-byte value-or-function-pointer storage,
backward compatible with raw constant init and assignment
- Revert api/user_services.h to original (uses TemplatableValue)
- Optimize sensor/number min_/max_ to TemplatableFn
- Optimize mdns port to TemplatableFn with lambda wrappers
2026-04-07 13:37:18 -10:00
J. Nick Koston
8cd78441a6
Revert "[sensor] Wrap filter constants in lambdas for TemplatableValue in benchmarks"
...
This reverts commit 5e2187581a .
2026-04-07 13:34:11 -10:00
J. Nick Koston
dc38cf0ced
Revert "[mdns] Wrap port assignments in stateless lambdas for TemplatableValue"
...
This reverts commit 1ba33e485a .
2026-04-07 13:34:11 -10:00
J. Nick Koston
5e2187581a
[sensor] Wrap filter constants in lambdas for TemplatableValue in benchmarks
2026-04-07 13:26:21 -10:00
J. Nick Koston
1ba33e485a
[mdns] Wrap port assignments in stateless lambdas for TemplatableValue
...
TemplatableValue<uint16_t> no longer accepts raw integer assignment.
Wrap USE_WEBSERVER_PORT, USE_SENDSPIN_PORT, and get_port() calls in
stateless lambdas.
2026-04-07 13:21:50 -10:00
J. Nick Koston
9bf0133525
[core] Specialize TemplatableValue for non-string types as function pointer
...
Specialize TemplatableValue so non-string types use function-pointer-only
storage (4 bytes on 32-bit) instead of the tagged union with std::function
support (8 bytes). The std::string specialization retains full support for
VALUE, STATIC_STRING, FLASH_STRING, and stateful lambdas.
Codegen now wraps non-string constants in stateless lambdas automatically,
so the generated C++ always assigns a function pointer.
2026-04-07 13:16:14 -10:00
Jonathan Swoboda
aad898503d
[multiple] Fix channel/pin range validation and widen channel types ( #15529 )
2026-04-07 18:37:17 -04:00
14bcdfe700
[emontx] emonTx component ( #9027 )
...
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: J. Nick Koston <nick@koston.org >
Co-authored-by: J. Nick Koston <nick@home-assistant.io >
2026-04-07 22:29:55 +00:00
Jonathan Swoboda
0d7f2f05b9
[libretiny] Fix board pin alias resolution TypeError ( #15527 )
2026-04-07 18:16:37 -04:00
ee7b38504b
[nextion] Expose custom protocol frames as automation triggers ( #13248 )
...
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com >
Co-authored-by: J. Nick Koston <nick@home-assistant.io >
2026-04-07 22:13:58 +00:00
J. Nick Koston
5d31f4aeba
[light] Use function-pointer fields in LightControlAction ( #15132 )
2026-04-07 12:00:17 -10:00
Jonathan Swoboda
9fe4d5c63d
[rp2040_pio_led_strip][rp2040_pio] Fix CUSTOM chipset crash and improve error message ( #15537 )
2026-04-07 11:56:50 -10:00
Jonathan Swoboda
97ad5ab35f
[udp] Fix on_receive only processing first automation ( #15538 )
2026-04-07 11:56:01 -10:00
Jonathan Swoboda
e7ddc6f6d3
[multiple] Fix validation ranges (batch 2) ( #15533 )
2026-04-07 17:54:57 -04:00
Jonathan Swoboda
cbcf80081b
[pcf8563] Fix default I2C address from 8-bit (0xA3) to 7-bit (0x51) ( #15526 )
2026-04-07 17:54:12 -04:00
Jonathan Swoboda
3073f3ec5c
[haier] Fix control_method schema incorrectly using ensure_list ( #15523 )
2026-04-07 17:53:16 -04:00
Jonathan Swoboda
5a52936f72
[graph] Fix legend config incorrectly accepting a list ( #15522 )
2026-04-07 17:52:33 -04:00
Jonathan Swoboda
3ca3cdc5e2
[multiple] Fix missing entity base classes in Python class declarations ( #15534 )
2026-04-07 11:44:28 -10:00
Jonathan Swoboda
4ebfe71b8f
[seeed_mr24hpc1] Move baud rate validation to FINAL_VALIDATE_SCHEMA ( #15536 )
2026-04-07 11:42:33 -10:00
Jonathan Swoboda
2fe6cb392b
[rotary_encoder] Fix set_value action accepting any sensor ID ( #15535 )
2026-04-07 11:40:43 -10:00
J. Nick Koston
f61d316bbb
Merge remote-tracking branch 'origin/light-control-action-compact' into integration
2026-04-07 11:28:50 -10:00
J. Nick Koston
35a7ba75de
reduce
2026-04-07 11:26:06 -10:00
J. Nick Koston
1ad84035c3
reduce
2026-04-07 11:24:19 -10:00
J. Nick Koston
e862b4f5fd
reduce
2026-04-07 11:23:37 -10:00
J. Nick Koston
0d65d23c05
lambda everything
2026-04-07 11:16:10 -10:00
Edward Firmo
d354747da0
[nextion] Fix format specifiers and error message typos in command handlers ( #15542 )
2026-04-07 21:10:56 +00:00
Jonathan Swoboda
17ec5389d8
[mcp4461] Fix terminal disable passing string where C++ expects char ( #15528 )
2026-04-07 11:07:28 -10:00
Jonathan Swoboda
687753b0be
[lightwaverf] Fix write pin using input schema instead of output ( #15525 )
2026-04-07 11:03:55 -10:00
Jonathan Swoboda
186525e77d
[ld2420] Fix select options wrapped in extra list ( #15524 )
2026-04-07 10:57:26 -10:00