From 8800c10181c56b785d44c9a34b73fac537c6eb53 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 11 Apr 2026 17:37:59 -1000 Subject: [PATCH] [core] Address review: fix docstrings per Copilot feedback - get_app_state(): say 'STATUS_LED_* only', not 'STATUS_LED_* and lifecycle' since lifecycle bits are no longer maintained in app_state_. - STATUS_LED_SETTLE_S: remove incorrect mention of feed_wdt re-dispatch; status_led_light is driven by the main loop, not feed_wdt. - snapshot_led service: say 'status_led_light output' not 'pin state' since the fixture uses a template output, not GPIO. --- esphome/core/application.h | 2 +- tests/integration/fixtures/status_flags.yaml | 2 +- tests/integration/test_status_flags.py | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/esphome/core/application.h b/esphome/core/application.h index fc6b5871548..374645d80a5 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -262,7 +262,7 @@ class Application { */ void teardown_components(uint32_t timeout_ms); - /// Return the public app state bits (STATUS_LED_* and lifecycle). + /// Return the public app state status bits (STATUS_LED_* only). /// Internal bookkeeping bits like APP_STATE_SETUP_COMPLETE are masked /// out so external readers (status_led components, etc.) never see them. uint8_t get_app_state() const { return this->app_state_ & ~APP_STATE_SETUP_COMPLETE; } diff --git a/tests/integration/fixtures/status_flags.yaml b/tests/integration/fixtures/status_flags.yaml index baa081e8903..cb118dcc84c 100644 --- a/tests/integration/fixtures/status_flags.yaml +++ b/tests/integration/fixtures/status_flags.yaml @@ -52,7 +52,7 @@ api: - component.update: app_warning_bit - component.update: app_error_bit - # Snapshot of the status_led's written pin state for observation. + # Snapshot of the status_led_light's output state for observation. - action: snapshot_led then: - component.update: status_led_writes diff --git a/tests/integration/test_status_flags.py b/tests/integration/test_status_flags.py index fcc011b1157..ffbc7c7f634 100644 --- a/tests/integration/test_status_flags.py +++ b/tests/integration/test_status_flags.py @@ -22,10 +22,9 @@ import pytest from .state_utils import InitialStateHelper, SensorTracker, build_key_to_entity_mapping from .types import APIClientConnectedFactory, RunCompiledFunction -# Time to let the main loop run so status_led_light writes to its output. -# feed_wdt re-dispatches every ~3 ms; 300 ms gives ~100 opportunities and -# is long enough that even a slow host-mode main loop produces measurable -# write-count changes. +# Time to let the host-mode main loop run so status_led_light.loop() can +# execute enough iterations to produce measurable write-count changes on +# the fake template output. 300 ms is well above the minimum needed. STATUS_LED_SETTLE_S = 0.3