Commit Graph

514 Commits

Author SHA1 Message Date
J. Nick Koston 85529ee518 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-03-29 12:36:30 -10:00
J. Nick Koston a9aaf29d83 [core] Shrink Component from 12 to 8 bytes per instance (#15103) 2026-03-29 12:09:21 -10:00
J. Nick Koston 5da3253f4b [esp8266] Add enable_scanf_float option (#15284) 2026-03-29 11:57:52 -10:00
J. Nick Koston a12dcc68a9 Merge remote-tracking branch 'upstream/component-8byte-optimization' into integration 2026-03-29 08:36:03 -10:00
J. Nick Koston fd8b8c6546 Merge branch 'dev' into component-8byte-optimization 2026-03-29 08:25:57 -10:00
J. Nick Koston db15bb2494 Merge remote-tracking branch 'upstream/callback-manager-no-vector' into integration 2026-03-28 08:27:47 -10:00
Jonathan Swoboda b6abfec82e [core] Fix area/device hash collision validation not running (#15259) 2026-03-27 22:22:24 -04:00
J. Nick Koston fa8a609bcc [automation] Eliminate trigger trampolines with deduplicated forwarder structs (#15174) 2026-03-26 13:50:50 -10:00
J. Nick Koston 4170f0ecb4 Merge remote-tracking branch 'origin/warn-verbose-logging' into integration 2026-03-26 09:43:45 -10:00
Jonathan Swoboda c2456409bd [core] Improve clean-all with no arguments (#15184) 2026-03-26 13:39:19 -04:00
J. Nick Koston 93232363e9 Merge remote-tracking branch 'upstream/eliminate-trigger-trampolines' into integration 2026-03-25 15:38:03 -10:00
J. Nick Koston bdc4a54613 Address review: const ref args, revert lock migration
- TriggerForwarder::operator() now takes const Ts&... to avoid
  copies of non-trivial types (e.g., std::string).
- Revert lock to trigger-based pattern: LockStateForwarder holds
  two pointers (automation + lock), exceeding sizeof(void*) which
  would cause Callback::create to heap-allocate.
- Remove forwarder_extra_args from API since lock was the only user.
2026-03-25 15:10:10 -10:00
J. Nick Koston 2465339d07 Merge remote-tracking branch 'upstream/eliminate-trigger-trampolines' into integration 2026-03-25 14:47:08 -10:00
J. Nick Koston 9be87f66c3 Accept custom forwarder types, migrate number and lock
Replace bool_filter with generic forwarder parameter that accepts
any struct type. Components can define their own forwarders with
custom fields (e.g., LockStateForwarder needs both automation and
lock entity pointers).

Migrates number (NumberStateTrigger) and lock (LockStateTrigger)
to prove the API is flexible enough for diverse patterns.
2026-03-25 14:23:35 -10:00
J. Nick Koston c127cacb9a Use template forwarder structs for callback deduplication
Replace per-site lambda generation with TriggerForwarder<Ts...>,
TriggerOnTrueForwarder, and TriggerOnFalseForwarder structs. The
compiler generates one operator() per forwarder type shared across
all call sites, avoiding flash duplication from unique lambdas.

Also cleans up API: replaces condition/callback_args with
bool_filter using TRIGGER_ON_TRUE/TRIGGER_ON_FALSE constants.
2026-03-25 14:16:30 -10:00
J. Nick Koston 6c905bd036 Add unit tests for trigger callback lambda generation
Tests the lambda output format for all variations used by
build_callback_automation: no args, typed args, conditions,
multiple args, and empty capture.
2026-03-25 14:09:10 -10:00
J. Nick Koston a22d47c719 [api] Add --no-states flag to esphome logs command (#15160) 2026-03-25 07:36:53 -10:00
J. Nick Koston 5b2d65b5c8 Merge branch 'state-log-no-states' into integration 2026-03-24 23:06:52 -10:00
J. Nick Koston 9befe1b299 [api] Add --no-states flag to esphome logs command
Pass subscribe_states through to aioesphomeapi's log runner so users
can suppress synthetic [S] state change lines in log output.
2026-03-24 23:00:06 -10:00
J. Nick Koston ff02bf8099 Merge branch 'state-publish-logv' into integration 2026-03-24 22:26:09 -10:00
Jonathan Swoboda 4ff85e2a1e [core] Fix clean-all to handle custom build paths (#15146)
Co-authored-by: J. Nick Koston <nick+github@koston.org>
2026-03-24 19:48:17 -04:00
J. Nick Koston 968fa1cadd Merge remote-tracking branch 'origin/api-warning-message' into integration 2026-03-24 10:19:55 -10:00
Javier Peletier 7eddf429ea [substitutions] speed up config loading: substitutions pass and !include redesign (package refactor part 4) (#12126)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-23 23:57:22 -10:00
J. Nick Koston 51de1ad0b9 Merge remote-tracking branch 'upstream/precompute-tag-forced-varint-fields' into integration
# Conflicts:
#	esphome/components/api/api_pb2_dump.cpp
#	esphome/components/sensor/sensor.h
2026-03-23 15:28:13 -10:00
Javier Peletier df4318505f [substitutions] refactor substitute() as a pure function (package refactor part 3) (#15031)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-23 14:28:04 -10:00
J. Nick Koston e63105b023 Merge remote-tracking branch 'upstream/wifi-esp8266-roam-scan-dwell' into integration 2026-03-23 13:14:26 -10:00
Javier Peletier bf6000ef3d [substitutions] substitutions pass and !include redesign (package refactor part 2b) (#14918)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-23 12:50:28 -10:00
J. Nick Koston cba87a22fb Add type annotations to new tests 2026-03-22 21:43:36 -10:00
J. Nick Koston c8d97830f2 Add non-empty test for _generate_source_table_code 2026-03-22 21:42:56 -10:00
J. Nick Koston f744568689 Merge remote-tracking branch 'upstream/component-8byte-optimization' into integration 2026-03-22 21:40:00 -10:00
J. Nick Koston f982dc9426 Add test for _generate_component_source_table with empty pool 2026-03-22 21:39:53 -10:00
J. Nick Koston 099bea00f6 Add test for _generate_source_table_code empty input 2026-03-22 21:30:22 -10:00
J. Nick Koston a92281f899 Add tests for register_component_source, remove redundant index check
- Test empty name returns 0
- Test deduplication returns same index
- Test overflow warns and returns 0
- Remove duplicate index==0 check in get_component_log_str() since
  component_source_lookup() already handles it
2026-03-22 21:24:13 -10:00
J. Nick Koston 33bb87b813 Simplify to uint8_t index, add friend declarations, fix tests
- Drop 9-bit index scheme in favor of plain uint8_t (max 255 unique
  source names, overflow warns in Python and returns 0)
- Add friend declarations for setup()/original_setup() so generated
  code can call protected set_component_source_()
- Move get_component_log_str() out of line
- Fix test mocks to provide CORE.data dict
2026-03-22 21:16:18 -10:00
J. Nick Koston 801b16f3fd Merge remote-tracking branch 'upstream/dev' into integration 2026-03-22 18:46:46 -10:00
J. Nick Koston 8a3b5a8def [core] Fix placement new storage name for templated types (#15096) 2026-03-23 16:09:23 +13:00
J. Nick Koston 6992219e34 [core] Attribute placement new storage symbols to components (#15092) 2026-03-22 16:27:07 -10:00
J. Nick Koston 20420d0016 Merge remote-tracking branch 'upstream/analyze-memory-pstorage-attribution' into integration 2026-03-22 15:05:20 -10:00
J. Nick Koston 2d10f8abd3 [analyze-memory] Attribute placement new storage symbols to components
Embed component namespace in storage variable names so analyze-memory
can reliably attribute them. Display as "storage for {id}" in reports
and always show regardless of size threshold.
2026-03-22 15:03:36 -10:00
J. Nick Koston 6a77b8b1f4 [light] Fix gamma LUT quantizing small brightness to zero (#15060) 2026-03-23 09:19:28 +13:00
J. Nick Koston 3f1bf4cd69 Merge remote-tracking branch 'upstream/fix-gamma-lut-zero-quantization' into integration 2026-03-21 10:32:28 -10:00
J. Nick Koston 41ff09d18a [light] Extract generate_gamma_table and add tests
Extract the gamma table generation into a public generate_gamma_table()
function and add unit tests covering table properties and the
zero_means_zero regression from #15055.
2026-03-21 08:23:52 -10:00
J. Nick Koston 02ada93ea5 [wifi] Reject WiFi config on RP2040/RP2350 boards without CYW43 chip (#14990) 2026-03-19 18:40:33 -10:00
J. Nick Koston 6348eafcb6 Merge remote-tracking branch 'upstream/fix-rp2040-wifi-validation' into integration 2026-03-19 16:15:46 -10:00
J. Nick Koston f8af05bbea Merge remote-tracking branch 'upstream/dev' into integration 2026-03-18 23:22:56 -10:00
Javier Peletier c2c50ceea7 [substitutions] substitutions pass and !include redesign (package refactor part 2a) (#14917)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-18 23:10:01 -10:00
J. Nick Koston 3e845d387a [tests] Fix test_show_logs_serial taking 30s due to unmocked serial port wait (#14903) 2026-03-17 14:44:17 -10:00
J. Nick Koston d27a54553c Merge remote-tracking branch 'upstream/fix-slow-serial-log-test' into integration
# Conflicts:
#	.github/workflows/ci.yml
#	esphome/components/esp32_ble_server/ble_server.cpp
#	esphome/components/mqtt/mqtt_backend_esp32.cpp
#	script/cpp_benchmark.py
#	script/determine-jobs.py
2026-03-17 14:30:31 -10:00
J. Nick Koston cdf05263df [tests] Fix test_show_logs_serial taking 30s due to unmocked serial port wait
The test was calling show_logs() which invokes _wait_for_serial_port("/dev/ttyUSB0").
Since that path doesn't exist in CI/dev environments, it spun in a 30-second polling
loop before returning. Add mock_wait_for_serial_port fixture to skip the wait.
2026-03-17 14:26:24 -10:00
Javier Peletier 0c5f055d45 [core] cpp tests: Allow customizing code generation during tests (#14681)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-18 00:16:01 +00:00