ESPHome  2022.9.1
Public Member Functions | Protected Attributes
esphome::graph::HistoryData Class Reference

#include <graph.h>

Public Member Functions

void init (int length)
 
 ~HistoryData ()
 
void set_update_time_ms (uint32_t update_time_ms)
 
void take_sample (float data)
 
int get_length () const
 
float get_value (int idx) const
 
float get_recent_max () const
 
float get_recent_min () const
 

Protected Attributes

uint32_t last_sample_
 
uint32_t period_ {0}
 
uint32_t update_time_ {0}
 in ms More...
 
int length_
 in ms More...
 
int count_ {0}
 
float recent_min_ {NAN}
 
float recent_max_ {NAN}
 
std::vector< float > samples_
 

Detailed Description

Definition at line 85 of file graph.h.

Constructor & Destructor Documentation

◆ ~HistoryData()

esphome::graph::HistoryData::~HistoryData ( )

Member Function Documentation

◆ get_length()

int esphome::graph::HistoryData::get_length ( ) const
inline

Definition at line 91 of file graph.h.

◆ get_recent_max()

float esphome::graph::HistoryData::get_recent_max ( ) const
inline

Definition at line 93 of file graph.h.

◆ get_recent_min()

float esphome::graph::HistoryData::get_recent_min ( ) const
inline

Definition at line 94 of file graph.h.

◆ get_value()

float esphome::graph::HistoryData::get_value ( int  idx) const
inline

Definition at line 92 of file graph.h.

◆ init()

void esphome::graph::HistoryData::init ( int  length)

Definition at line 18 of file graph.cpp.

◆ set_update_time_ms()

void esphome::graph::HistoryData::set_update_time_ms ( uint32_t  update_time_ms)
inline

Definition at line 89 of file graph.h.

◆ take_sample()

void esphome::graph::HistoryData::take_sample ( float  data)

Definition at line 24 of file graph.cpp.

Field Documentation

◆ count_

int esphome::graph::HistoryData::count_ {0}
protected

Definition at line 101 of file graph.h.

◆ last_sample_

uint32_t esphome::graph::HistoryData::last_sample_
protected

Definition at line 97 of file graph.h.

◆ length_

int esphome::graph::HistoryData::length_
protected

in ms

Definition at line 100 of file graph.h.

◆ period_

uint32_t esphome::graph::HistoryData::period_ {0}
protected

Definition at line 98 of file graph.h.

◆ recent_max_

float esphome::graph::HistoryData::recent_max_ {NAN}
protected

Definition at line 103 of file graph.h.

◆ recent_min_

float esphome::graph::HistoryData::recent_min_ {NAN}
protected

Definition at line 102 of file graph.h.

◆ samples_

std::vector<float> esphome::graph::HistoryData::samples_
protected

Definition at line 104 of file graph.h.

◆ update_time_

uint32_t esphome::graph::HistoryData::update_time_ {0}
protected

in ms

Definition at line 99 of file graph.h.


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