ESPHome  2022.8.0
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 (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

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 254 of file filter.h.

Constructor & Destructor Documentation

◆ OffsetFilter()

esphome::sensor::OffsetFilter::OffsetFilter ( float  offset)
explicit

Definition at line 274 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 276 of file filter.cpp.

Field Documentation

◆ offset_

float esphome::sensor::OffsetFilter::offset_
protected

Definition at line 261 of file filter.h.


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