|
ESPHome 2026.5.3
|
Base class for filters that compare sensor values against a fixed list of configured values. More...
#include <filter.h>
Protected Member Functions | |
| ValueListFilter (std::initializer_list< TemplatableFn< float > > values) | |
| bool | value_matches_any_ (float sensor_value) |
| Check if sensor value matches any configured value (with accuracy rounding) | |
Protected Attributes | |
| std::array< TemplatableFn< float >, N > | values_ {} |
Protected Attributes inherited from esphome::sensor::Filter | |
| friend | Sensor |
| Filter * | next_ {nullptr} |
| Sensor * | parent_ {nullptr} |
Additional Inherited Members | |
Public Member Functions inherited from esphome::sensor::Filter | |
| virtual optional< float > | new_value (float value)=0 |
| This will be called every time the filter receives a new value. | |
| virtual void | initialize (Sensor *parent, Filter *next) |
| Initialize this filter, please note this can be called more than once. | |
| void | input (float value) |
| void | output (float value) |
Base class for filters that compare sensor values against a fixed list of configured values.
Templated on N (the number of values) so the list is stored inline in a std::array, avoiding heap allocation and the overhead of FixedVector.
| N | Number of values in the filter list, set by code generation to match the exact number of values configured in YAML. |
|
inlineexplicitprotected |
|
inlineprotected |
|
protected |