Commit Graph
467 Commits
Author SHA1 Message Date
J. Nick Koston b7a2820ffe Merge branch 'analyze-memory-dedup-aliased-ram-symbols' into integration 2026-07-05 23:00:31 -05:00
Jonathan Swoboda b8690c8e31 [core] Drop Python 3.11 support (#17280) 2026-06-29 12:32:28 -04:00
Bonne EgglestonandJonathan Swoboda 8434d54cc7 [modbus] Reinstate turnaround delay after broadcasts (Revert #17209) (#17263)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-06-28 17:07:25 -04:00
Jonathan Swoboda 1d5490fd91 [modbus] Only apply turnaround delay after broadcasts (#17209) 2026-06-25 11:38:34 -04:00
J. Nick Koston c4abc5476e [core] Remove deprecated std::string scheduler/timer overloads (#17111) 2026-06-21 16:22:08 -05:00
Bonne Eggleston 63d8a344c5 [modbus] Fix parsing & split out server mode (#11969) 2026-06-21 13:32:35 -05:00
J. Nick Koston 4ae6dc355f [select] Remove deprecated state member (#17027) 2026-06-19 17:08:07 +12:00
J. Nick Koston b97182d302 [logger] Hold recursion guard while draining the task log buffer (#17044) 2026-06-19 09:16:14 +12:00
J. Nick Koston 70c11a7f3e Merge remote-tracking branch 'upstream/logger-buffered-recursion-guard' into integration 2026-06-18 16:12:45 -05:00
J. Nick Koston 0b37b9a202 [logger] Wait deterministically for buffered drain in test
Replace the fixed asyncio.sleep(0.5) with a wait on an asyncio.Event that
fires once all thread messages have arrived over the API. Every buffered
message is delivered whether it survives intact or gets clobbered, so counting
THREADMSG occurrences is a deterministic drain-complete signal with no arbitrary
sleep and no dependence on the fix being present.
2026-06-18 14:51:04 -05:00
J. Nick Koston c694e96f24 [logger] Hold recursion guard while draining the task log buffer
The synchronous logging path holds the main-task recursion guard around
notify_listeners_, but the buffered drain in Logger::process_messages_ did not.
When a message logged from a non-main thread was drained on the main loop and a
listener (the API log forwarder, or a logger.on_message automation) logged again
on the main task, that re-entrant log reused the shared tx_buffer_ and the API
shared_write_buffer_ while they were still in use, corrupting the in-flight
message; on ESP32 this surfaced as a StoreProhibited panic in the API send path.

Hold a RecursionGuard on main_task_recursion_guard_ across the drain so re-entrant
main-task logs are dropped there too, mirroring the synchronous path.

Adds an integration test that drives the buffered drain with a re-entrant
on_message log and verifies the buffered messages are delivered uncorrupted.
2026-06-18 14:07:03 -05:00
rwrozelleandClaude Sonnet 4.6 4b8568e948 [socket] bugfix Set wake-request gate flag on LwIP socket receive event (#17010)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 13:54:29 +12:00
J. Nick Koston 3420cff316 [core] Attribute "took a long time" blocking warning to the owning script (#16768) 2026-06-16 08:46:33 +12:00
J. Nick Koston 3cc875c40b [core] Enable ruff BLE (flake8-blind-except) lint family (#16659) 2026-05-27 20:09:57 +12:00
J. Nick Koston 3ce95682ca Merge remote-tracking branch 'origin/cv-sensitive-redact-sentinel' into integration 2026-05-26 23:51:13 -05:00
J. Nick Koston ceb9d406e1 [core] Enable ruff PIE (flake8-pie) lint family (#16658) 2026-05-26 07:46:44 -04:00
J. Nick Koston ae74920b81 [core] Enable ruff PTH (flake8-use-pathlib) lint family (#16661) 2026-05-26 05:14:42 +00:00
J. Nick Koston ae814cff5c [core] Enable ruff B (flake8-bugbear) lint family (#16655) 2026-05-26 02:28:14 +00:00
J. Nick Koston 8edc9f4cc8 Merge remote-tracking branch 'upstream/dev' into integration 2026-05-12 12:52:15 -05:00
J. Nick Koston 727c74da3f [script] Fix array-type parameters in script.execute (#16374) 2026-05-12 12:17:23 -05:00
J. Nick Koston a52ca4f80a [ota] Implement host platform OTA backend with re-exec for integration testing (#16304) 2026-05-11 10:51:08 -05:00
Jonathan Swoboda e4d9786f00 [core] Move platformio files to subfolder (#16347) 2026-05-11 21:34:47 +12:00
Jonathan Swoboda 696a654733 [clang-tidy] Concatenate nested namespaces (7/7: tests, platform-gated, enable check) (#16307) 2026-05-07 23:05:17 -04:00
J. Nick Koston f295d6b056 Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	esphome/__main__.py
#	esphome/components/api/client.py
#	esphome/components/bl0942/bl0942.cpp
#	esphome/components/cover/__init__.py
#	esphome/components/cover/automation.h
#	esphome/components/esphome/ota/ota_esphome.cpp
#	esphome/components/ota/ota_backend_esp_idf.cpp
#	esphome/components/ota/ota_partitions_esp_idf.cpp
#	esphome/espota2.py
#	tests/components/template/common-base.yaml
#	tests/unit_tests/components/api/test_client.py
#	tests/unit_tests/test_main.py
2026-05-06 16:47:31 -05:00
Mat931J. Nick Kostonpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>J. Nick Koston
90693fb39a [core] Fix WiFi connection in safe mode (#16269)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-05-06 09:56:33 -05:00
J. Nick Koston 39b2b901f7 [core] Replace scheduler pool vector with unbounded intrusive freelist (#16172) 2026-05-05 18:26:19 -05:00
J. Nick Koston 53c4e6f386 [tests] Drop duplicate on_boot_restore_from in host_mode_climate_basic_state (#16228) 2026-05-03 20:12:51 -05:00
J. Nick Koston 013dee44eb [binary_sensor] Drop Component from AutorepeatFilter, use self-keyed scheduler (#16191) 2026-05-03 20:05:27 -05:00
J. Nick Koston 120d1e51fb [tests] Fix flaky host_mode_climate_basic_state integration test (#16192) 2026-05-03 20:04:34 -05:00
J. Nick Koston 72a75f2d3f [cover] Fold ControlAction/CoverPublishAction fields into stateless lambdas (#16046) 2026-05-03 20:02:07 -05:00
J. Nick Koston df1200629f [tests] Fix flaky host_mode_climate_basic_state (#16225) 2026-05-03 19:44:11 -05:00
J. Nick Koston 5c015ede77 Merge remote-tracking branch 'upstream/fix-flaky-host-mode-climate-basic-state' into integration 2026-05-03 18:20:34 -05:00
J. Nick Koston 37a44a8a6f [tests] Fix flaky host_mode_climate_basic_state by ignoring prior MEMORY state
The fixture shares the `host-climate-test` build dir with
host_mode_climate_control.yaml. When the control test runs first and
leaves the thermostat in HEAT mode, MEMORY restore on the next basic_state
boot picked up HEAT and the initial-state assertion failed
(`assert ClimateMode.HEAT == ClimateMode.OFF`).
2026-05-03 17:39:39 -05:00
J. Nick Koston 3d69169141 [climate] Fold ControlAction fields into a single stateless lambda (#16044) 2026-04-30 19:16:16 -05:00
J. Nick Koston 20743e3e9a Merge branch 'scheduler-pool-unbounded-freelist' into integration 2026-04-30 11:06:46 -05:00
J. Nick Koston 2a451cb870 [core] Strengthen scheduler-pool integration test with lower-bound check
Adds an assertion that the observed peak pool size exceeds the old
MAX_POOL_SIZE=5 cap. Without this, a silent regression that re-introduced a
small cap could pass the existing pool_full_count == 0 invariant. Phase 5 + 6
of the fixture schedule 8 + 10 same-component timeouts, so the peak should
comfortably exceed 5.

Address Copilot review feedback on PR.
2026-04-30 10:57:11 -05:00
J. Nick Koston f9b87d0ede [core] Replace scheduler pool vector with unbounded intrusive freelist
The fixed MAX_POOL_SIZE=5 cap was the source of the heap churn the pool was
meant to prevent: any device with more than 5 concurrent timers (e.g. a board
with 30+ LD2450 sensors) hit a steady-state oscillation of recycle->delete and
acquire->new on every loop iteration.

Replace std::vector<SchedulerItem*> with a singly-linked freelist threaded
through SchedulerItem::next_free, which shares storage with `component` via an
anonymous union (zero per-item overhead -- the component pointer is dead while
pooled). Drop the cap entirely: the freelist quiesces at the application's
natural concurrent-timer high-water mark, which is the working set the device
already needs while those timers are active.

No std::vector means no growth-doubling slack and no realloc copies during
warm-up. Caller of get_item_from_pool_locked_() must overwrite item->component
before unlocking (already true at the sole call site); nullptr remains a valid
live `component` value for SELF_POINTER items, so we cannot pre-clear it.
2026-04-30 10:42:46 -05:00
J. Nick Koston 8246b09445 Merge branch 'ota-watchdogmanager' into integration 2026-04-29 14:34:36 -05:00
J. Nick Koston c41f38e16d [scheduler] Add self-keyed timer API for callers without a Component (#16127) 2026-04-29 13:24:37 -05:00
J. Nick Koston e5b1991cf7 [fan] Add tests for fan.turn_on action field combinations (#16125) 2026-04-29 12:46:06 -05:00
J. Nick Koston 7fba57ce51 [valve] Add tests for valve.control action field combinations (#16126) 2026-04-29 12:45:30 -05:00
J. Nick Koston e6f86b343c Merge remote-tracking branch 'upstream/binary-sensor-filters-drop-component' into integration 2026-04-29 11:08:17 -05:00
J. Nick Koston e3fdea8ce1 [scheduler] Address Copilot feedback: %p type, NameType doc, test docstring
- Strip const for the %p varargs call (the format spec takes void*, not
  const void*; same representation everywhere but pedantically correct).
- Mention SELF_POINTER in the NameType discriminator comment.
- Update test docstring to match the actual const void * signatures.
2026-04-29 11:06:04 -05:00
J. Nick Koston ba34021e8e Merge remote-tracking branch 'upstream/sensor-filters-drop-component' into integration 2026-04-29 10:21:49 -05:00
J. Nick Koston 9745a3299e [scheduler] Address review feedback (const void *, %p cast, buffer size) 2026-04-29 09:34:45 -05:00
J. Nick Koston 241d7797e3 [scheduler] Add self-keyed timer API for callers without a Component 2026-04-29 09:18:09 -05:00
J. Nick Koston dc48f2df13 Merge remote-tracking branch 'origin/cover-action-bitmask' into integration 2026-04-29 07:41:16 -05:00
J. Nick Koston 01a4769a5d Merge remote-tracking branch 'origin/climate-control-action-bitmask' into integration 2026-04-29 07:41:08 -05:00
J. Nick Koston f7c8df8234 [cover] Address review feedback (const ref args, drop mask numbering) 2026-04-29 06:56:18 -05:00
J. Nick Koston a7a45a556b [climate] Address review feedback (const ref args, utf-8 byte length, comments) 2026-04-29 06:54:23 -05:00