mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
bf917144c4719b96ce09cda0ac2becd800451f01
Saves 4 B per ThrottleAverageFilter instance (28 B → 24 B on 32-bit). have_nan_ is a single boolean that previously cost 4 B due to padding; fold it into the high bit of n_ as a 31-bit + 1-bit bitfield. To guarantee n_ cannot overflow under realistic configurations, cap the YAML time_period at 24 h. At a pessimistic 1 kHz source rate the counter peaks at 86.4M, leaving 25x headroom against 2^31. Anyone needing multi-day rolling averages should be using a different filtering strategy anyway. Breaking change: configurations with throttle_average periods longer than 24 h will now fail validation. No real-world configs are expected to use such values.
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%
