mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
ecdbe0f9bb29f01a47fb922731663b8171b3bc15
Previously loop_tail_start_us defaulted to loop_before_end_us, so on ticks where Phase B was gated out (loop_interval_ not yet elapsed, no wake, no high-frequency request) tail_us measured "time from end of Phase A to stats recording" — i.e. gate-check + stats-prefix overhead — and was accumulated into the per-tick "tail" bucket even though no component tail had actually run. That mis-attributed gate-check + stats-prefix overhead to the tail metric, which is supposed to represent trailing overhead of the component phase specifically (after_component_phase_ + the little bit before record_loop_active). On a device whose loop_interval_ is raised for power savings, Phase A-only ticks dominate and the mis-attributed tail would skew the stats report. Fix: gate the tail_us computation on do_component_phase. Initialize loop_tail_start_us to 0 (unused on Phase A-only ticks) and only subtract from loop_now_us when Phase B ran. The overhead that used to land in "tail" now falls into "residual" (active − before − components − tail), which is the correct bucket for per-iteration bookkeeping that is not phase-specific.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
545 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
