ESPHome  2024.11.3
Public Member Functions | Protected Attributes
esphome::sensor::OffsetFilter Class Reference

A simple filter that adds offset to each value it receives. More...

#include <filter.h>

Inheritance diagram for esphome::sensor::OffsetFilter:
esphome::sensor::Filter

Public Member Functions

 OffsetFilter (TemplatableValue< float > offset)
 
optional< float > new_value (float value) override
 
- Public Member Functions inherited from esphome::sensor::Filter
virtual void initialize (Sensor *parent, Filter *next)
 Initialize this filter, please note this can be called more than once. More...
 
void input (float value)
 
void output (float value)
 

Protected Attributes

TemplatableValue< float > offset_
 
- Protected Attributes inherited from esphome::sensor::Filter
friend Sensor
 
Filternext_ {nullptr}
 
Sensorparent_ {nullptr}
 

Detailed Description

A simple filter that adds offset to each value it receives.

Definition at line 275 of file filter.h.

Constructor & Destructor Documentation

◆ OffsetFilter()

esphome::sensor::OffsetFilter::OffsetFilter ( TemplatableValue< float >  offset)
explicit

Definition at line 291 of file filter.cpp.

Member Function Documentation

◆ new_value()

optional< float > esphome::sensor::OffsetFilter::new_value ( float  value)
overridevirtual

Implements esphome::sensor::Filter.

Definition at line 293 of file filter.cpp.

Field Documentation

◆ offset_

TemplatableValue<float> esphome::sensor::OffsetFilter::offset_
protected

Definition at line 282 of file filter.h.


The documentation for this class was generated from the following files: