Commit Graph
28164 Commits
Author SHA1 Message Date
J. Nick Koston de7f8ca68d Merge remote-tracking branch 'upstream-ssh/scheduler-freshen-loop-start-time' into integration 2026-04-27 15:31:55 -05:00
J. Nick Koston fa593bf0ee Merge remote-tracking branch 'upstream-ssh/feedback-cover-loop-component-start-time' into integration 2026-04-27 15:31:47 -05:00
J. Nick Koston 3ffbc4ef54 Shorten comments 2026-04-27 15:31:24 -05:00
J. Nick Koston 0ba825a8f0 Make set_loop_component_start_time_ protected with Scheduler friend 2026-04-27 15:29:10 -05:00
J. Nick Koston 95977bcccb [core] Freshen loop_component_start_time_ before scheduler dispatch 2026-04-27 15:28:23 -05:00
J. Nick Koston 6f0612be13 [feedback] Use App.get_loop_component_start_time() and constexpr timeout id 2026-04-27 15:26:43 -05:00
Mat931andJ. Nick Koston 7198c912c7 [esp32][wifi] Fix bootloop and WiFi connection issue if nvs partition is missing or has non-default label (#16025)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-27 12:41:28 -05:00
J. Nick Koston d44a27294e Merge branch 'fix-nvs-bootloop' into integration 2026-04-27 12:29:03 -05:00
J. Nick Koston 8af10c0c97 Distinguish erased-NVS from NVS-unavailable in deferred warning
If the erase+reopen recovery also fails (e.g. missing/mislabeled NVS
partition), nvs_handle stays 0. Report that state explicitly instead of
claiming NVS was erased.
2026-04-27 10:06:05 -05:00
J. Nick Koston 98f250b62c Defer nvs_open warning instead of dropping it
Stash the err code in a static and emit ESP_LOGW lazily from the first
make_preference() call (which runs after Logger::pre_setup() at
EARLY_INIT priority), so the diagnostic stays visible without
dereferencing global_logger before it is set.
2026-04-27 09:53:40 -05:00
J. Nick Koston 6f07939624 Revert "Revert "[bk72xx] Add BK7238 boards in preparation for upstream support""
This reverts commit 0f69504dd0.
2026-04-27 09:33:51 -05:00
J. Nick Koston 0f69504dd0 Revert "[bk72xx] Add BK7238 boards in preparation for upstream support"
This reverts commit 1a0642546b.
2026-04-27 09:30:07 -05:00
J. Nick Koston 4cd3431884 Merge remote-tracking branch 'origin/wifi_phy_mode_esp8266' into integration 2026-04-27 08:08:53 -05:00
J. Nick Koston 16bc151758 [wifi] Log phy_mode in dump_config 2026-04-27 08:01:30 -05:00
J. Nick Koston 191115bf18 Merge remote-tracking branch 'origin/ota-wakeable-delay-yield' into integration 2026-04-27 07:55:22 -05:00
J. Nick Koston 465e34be39 Merge remote-tracking branch 'origin/ota-data-loop-timeout' into integration 2026-04-27 07:54:59 -05:00
J. Nick Koston ee0da8a482 Merge remote-tracking branch 'origin/wifi_phy_mode_esp8266' into integration 2026-04-27 07:50:19 -05:00
J. Nick Koston 4f4ad64f19 [wifi] Add explicit AUTO option to phy_mode 2026-04-27 07:49:29 -05:00
J. Nick Koston e232325a33 [wifi] Add phy_mode option for ESP8266 2026-04-27 07:43:21 -05:00
Kevin Ahrendt 24c6a0d711 [audio] Bump microDecoder library to v0.2.0 (#16054) 2026-04-27 12:17:02 +00:00
dec5d0449b [esp32_ble_tracker] Hold COEX_PREFER_BT for the lifetime of any active connection (#16036)
Co-authored-by: Paul Lazarre <plazarre@gmail.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-04-27 06:51:54 -05:00
J. Nick Koston 3c9b42a43f Merge branch 'fix-coex-revert-during-active-connection' into integration 2026-04-27 06:46:49 -05:00
J. Nick Koston 24a0db1029 Merge remote-tracking branch 'origin/test-cover-control-action' into integration 2026-04-27 06:46:18 -05:00
J. Nick Koston 5f15dc9ba4 Merge remote-tracking branch 'origin/test-climate-control-action' into integration 2026-04-27 06:46:14 -05:00
J. Nick Koston d26e29d89c Merge remote-tracking branch 'origin/light-toggle-action-constexpr-template' into integration 2026-04-27 06:46:06 -05:00
J. Nick Koston 4ed7956094 Merge remote-tracking branch 'origin/light-dim-relative-constexpr-template' into integration 2026-04-27 06:46:00 -05:00
J. Nick Koston 26e8fcbfa9 Merge remote-tracking branch 'origin/inline-continuation-actions' into integration 2026-04-27 06:45:52 -05:00
J. Nick Koston 1135eeaf99 Merge remote-tracking branch 'origin/cover-action-bitmask' into integration 2026-04-27 06:45:48 -05:00
J. Nick Koston c3a830cebd Merge remote-tracking branch 'origin/api-connection-incomplete-type' into integration 2026-04-27 06:45:38 -05:00
J. Nick Koston a46d7e0a6a [cover] Also exercise cover.template.publish with state: alias 2026-04-27 06:42:15 -05:00
J. Nick Koston c60cf7f5b7 [climate] Add climate.control coverage to component tests via thermostat 2026-04-27 06:21:56 -05:00
J. Nick Koston 50b0474d60 [cover] Reword: generic coverage, not bitmask-specific 2026-04-27 06:20:43 -05:00
J. Nick Koston 53454adc40 [cover] Add cover.control / cover.template.publish coverage to template tests 2026-04-27 06:19:39 -05:00
J. Nick Koston acc15ff495 [api] Use custom deleter to fix incomplete-type error on macOS libc++
libc++ eagerly instantiates the unique_ptr<APIConnection> destructor
when std::array<std::unique_ptr<APIConnection>, N> is parsed, requiring
sizeof(APIConnection). api_server.h only forward-declares APIConnection
(via list_entities.h), so the destructor instantiation fails for any
translation unit that includes api_server.h without also including
api_connection.h first.

Wrap the unique_ptr in a custom deleter (APIConnectionDeleter) whose
operator() is defined out-of-line in api_server.cpp where APIConnection
is complete. The default_delete<APIConnection> path is never
instantiated, so libc++'s incomplete-type assertion is avoided.

GCC/libstdc++ already deferred this instantiation, so this only affects
macOS host-platform builds (used by integration tests).
2026-04-27 05:59:21 -05:00
J. Nick Koston 801cfe621b [ota] Fix clang-tidy goto-jumps-init and set error_code on timeout
Address two issues on the new data-loop timeout:

- clang-tidy ESP32 Arduino flagged "cannot jump from this goto statement to its label" at the existing pre-loop `goto error` sites because the new `uint32_t last_data_ms = millis();` declaration sat between them and the `error:` label, so the jumps would skip past its initialization. Move the declaration up next to the other handle_data_ locals (`total`, `last_progress`) and just assign it before the loop entry. The earlier gotos no longer cross an init.

- Copilot pointed out the new timeout `goto error` left `error_code` at `OTA_RESPONSE_OK` (set by `backend_->begin()`), so the device would write OK back to the uploader even though it was aborting. Set `error_code = ota::OTA_RESPONSE_ERROR_UNKNOWN` before the goto so the uploader receives a correct failure code.
2026-04-27 05:54:32 -05:00
J. Nick Koston 6770a6b87f [cover] Address Copilot review on integration test fixture and macro comments 2026-04-27 05:39:21 -05:00
J. Nick Koston fbafade78c [ota] Add wall-clock timeout to OTA data transfer loop
The main `while (total < ota_size)` loop in `ESPHomeOTAComponent::handle_data_()`
had a `// TODO: timeout check` and no wall-clock guard. If the uploader
side dropped the TCP connection without a FIN/RST being delivered to
the device (uploader process killed mid-transfer, NAT/router state
dropped, packet loss eating the RST), `recv_fn` would never see a
close and `s_err_fn` would never fire, so:

- `pcb_` stays non-null
- `rx_closed_` stays false
- `waiting_for_data_()` stays true forever
- the loop spins on `EWOULDBLOCK`, fed by `App.feed_wdt(); continue;`,
  indefinitely

LwIP TCP keepalive is not enabled on the OTA socket, and even when
enabled the default keepalive timer is on the order of hours, so the
device is effectively unresponsive until power cycle. This matches
the "device unresponsive until I do a hard power-reset" symptom in
issue #15953.

Track the timestamp of the last successful read and abort if no data
arrives for `OTA_SOCKET_TIMEOUT_DATA` (90s, same constant the handshake,
`readall_()`, and `writeall_()` already use). The timeout resets on
every successful read so a slow but live link does not false-trigger.
2026-04-27 05:29:40 -05:00
J. Nick Koston 1ab588f10e [core] Drop redundant inline_continuation test (covered by test_continuation_actions) 2026-04-27 05:11:11 -05:00
J. Nick Koston 65b5615a31 [light] Use InitialStateHelper in DimRelativeAction integration test 2026-04-27 05:10:02 -05:00
J. Nick Koston 83f83c96a8 [light] Use InitialStateHelper in ToggleAction integration test 2026-04-27 05:09:27 -05:00
J. Nick Koston a532f0adc9 [cover] Use InitialStateHelper in integration test 2026-04-27 05:08:08 -05:00
J. Nick Koston 23e64de392 [core] Add integration test for inline ContinuationAction 2026-04-27 05:07:14 -05:00
J. Nick Koston 2eac9f5121 [light] Add integration test for DimRelativeAction 2026-04-27 05:05:00 -05:00
J. Nick Koston e9ced485ea [light] Add integration test for ToggleAction 2026-04-27 05:04:28 -05:00
J. Nick Koston 3522eef8ee [cover] Add integration test for ControlAction/CoverPublishAction 2026-04-27 05:02:58 -05:00
J. Nick Koston feaa903056 [cover] Use bitmask template parameter for ControlAction/CoverPublishAction
Apply the bitmask pattern from LightControlAction (#16039) to
cover::ControlAction (3 fields: stop, position, tilt) and
cover::CoverPublishAction (3 fields: position, tilt, current_operation).
Unused fields are elided via [[no_unique_address]] and skipped at
compile time in play() via if constexpr.

Codegen for cover.control: and cover.template.publish: builds the
bitmask from the YAML keys present. CONF_STATE and CONF_POSITION
both map to the same position bit (they are mutually exclusive YAML
keys for the same C++ field).

Per-instance: 16-28 B depending on which fields are set, down from
~28 B baseline.
2026-04-27 04:58:35 -05:00
J. Nick Koston c30aa4aad4 [core] wakeable_delay: yield on already-woken fast path (ESP8266, RP2040)
When `g_main_loop_woke` is already set on entry to `wakeable_delay()`,
both the ESP8266 and RP2040 paths consume the flag and return without
yielding. That's safe in isolation, but if a caller loops on
`wakeable_delay()` (e.g. `LWIPRawImpl::wait_for_data_()` waiting for
SO_RCVTIMEO), and ISR sources (GPIO, timer, WiFi RX on ESP8266; alarm
/ async on RP2040) keep re-setting the flag between iterations, every
iteration takes the fast path and the loop never yields.

That can starve the SDK / async context, blocking actual TCP delivery
to our socket and causing OTA reads to time out on busy devices even
though there is data in flight. The PR that introduced
`wait_for_data_()` (#14675) relied on `wakeable_delay()` to yield on
every iteration; this restores that property on the fast path.

Adds `delay(0)` on ESP8266 and `yield()` on RP2040 to the fast path,
matching the yield behaviour those platforms already use for the
`ms == 0` poll case.
2026-04-27 04:55:43 -05:00
J. Nick Koston 35f043d671 Merge branch 'inline-continuation-actions' into integration 2026-04-26 22:51:19 -05:00
J. Nick Koston 83d879265e [core] Document add_then/add_else single-call precondition 2026-04-26 22:32:58 -05:00
J. Nick Koston e85de4d34a [core] Document add_then/add_else single-call precondition 2026-04-26 22:32:26 -05:00