|
ESPHome 2026.3.2
|
Base class for filters that compare sensor values against a list of configured values. More...
#include <filter.h>
Protected Member Functions | |
| ValueListFilter (std::initializer_list< TemplatableValue< float > > values) | |
| bool | value_matches_any_ (float sensor_value) |
| Check if sensor value matches any configured value (with accuracy rounding) | |
Protected Attributes | |
| FixedVector< TemplatableValue< float > > | 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 list of configured values.
This base class provides common functionality for filters that need to check if a sensor value matches any value in a configured list, with proper handling of NaN values and accuracy-based rounding for comparisons.
|
explicitprotected |
Definition at line 240 of file filter.cpp.
|
protected |
Check if sensor value matches any configured value (with accuracy rounding)
Definition at line 242 of file filter.cpp.
|
protected |