ESPHome  2022.9.1
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
esphome::hm3301::CAQICalculator Class Reference

#include <caqi_calculator.h>

Inheritance diagram for esphome::hm3301::CAQICalculator:
esphome::hm3301::AbstractAQICalculator

Public Member Functions

uint16_t get_aqi (uint16_t pm2_5_value, uint16_t pm10_0_value) override
 

Protected Member Functions

int calculate_index_ (uint16_t value, int array[AMOUNT_OF_LEVELS][2])
 
int get_grid_index_ (uint16_t value, int array[AMOUNT_OF_LEVELS][2])
 

Protected Attributes

int index_grid_ [AMOUNT_OF_LEVELS][2] = {{0, 25}, {26, 50}, {51, 75}, {76, 100}, {101, 400}}
 
int pm2_5_calculation_grid_ [AMOUNT_OF_LEVELS][2] = {{0, 15}, {16, 30}, {31, 55}, {56, 110}, {111, 400}}
 
int pm10_0_calculation_grid_ [AMOUNT_OF_LEVELS][2] = {{0, 25}, {26, 50}, {51, 90}, {91, 180}, {181, 400}}
 

Static Protected Attributes

static const int AMOUNT_OF_LEVELS = 5
 

Detailed Description

Definition at line 9 of file caqi_calculator.h.

Member Function Documentation

◆ calculate_index_()

int esphome::hm3301::CAQICalculator::calculate_index_ ( uint16_t  value,
int  array[AMOUNT_OF_LEVELS][2] 
)
inlineprotected

Definition at line 27 of file caqi_calculator.h.

◆ get_aqi()

uint16_t esphome::hm3301::CAQICalculator::get_aqi ( uint16_t  pm2_5_value,
uint16_t  pm10_0_value 
)
inlineoverridevirtual

Implements esphome::hm3301::AbstractAQICalculator.

Definition at line 11 of file caqi_calculator.h.

◆ get_grid_index_()

int esphome::hm3301::CAQICalculator::get_grid_index_ ( uint16_t  value,
int  array[AMOUNT_OF_LEVELS][2] 
)
inlineprotected

Definition at line 41 of file caqi_calculator.h.

Field Documentation

◆ AMOUNT_OF_LEVELS

const int esphome::hm3301::CAQICalculator::AMOUNT_OF_LEVELS = 5
staticprotected

Definition at line 19 of file caqi_calculator.h.

◆ index_grid_

int esphome::hm3301::CAQICalculator::index_grid_[AMOUNT_OF_LEVELS][2] = {{0, 25}, {26, 50}, {51, 75}, {76, 100}, {101, 400}}
protected

Definition at line 21 of file caqi_calculator.h.

◆ pm10_0_calculation_grid_

int esphome::hm3301::CAQICalculator::pm10_0_calculation_grid_[AMOUNT_OF_LEVELS][2] = {{0, 25}, {26, 50}, {51, 90}, {91, 180}, {181, 400}}
protected

Definition at line 25 of file caqi_calculator.h.

◆ pm2_5_calculation_grid_

int esphome::hm3301::CAQICalculator::pm2_5_calculation_grid_[AMOUNT_OF_LEVELS][2] = {{0, 15}, {16, 30}, {31, 55}, {56, 110}, {111, 400}}
protected

Definition at line 23 of file caqi_calculator.h.


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