ESPHome  2024.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
esphome::hm3301::AQICalculator Class Reference

#include <aqi_calculator.h>

Inheritance diagram for esphome::hm3301::AQICalculator:
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, 51}, {51, 100}, {101, 150}, {151, 200}, {201, 300}, {301, 500}}
 
int pm2_5_calculation_grid_ [AMOUNT_OF_LEVELS][2] = {{0, 12}, {13, 35}, {36, 55}, {56, 150}, {151, 250}, {251, 500}}
 
int pm10_0_calculation_grid_ [AMOUNT_OF_LEVELS][2]
 

Static Protected Attributes

static const int AMOUNT_OF_LEVELS = 6
 

Detailed Description

Definition at line 8 of file aqi_calculator.h.

Member Function Documentation

◆ calculate_index_()

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

Definition at line 27 of file aqi_calculator.h.

◆ get_aqi()

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

Implements esphome::hm3301::AbstractAQICalculator.

Definition at line 10 of file aqi_calculator.h.

◆ get_grid_index_()

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

Definition at line 37 of file aqi_calculator.h.

Field Documentation

◆ AMOUNT_OF_LEVELS

const int esphome::hm3301::AQICalculator::AMOUNT_OF_LEVELS = 6
staticprotected

Definition at line 18 of file aqi_calculator.h.

◆ index_grid_

int esphome::hm3301::AQICalculator::index_grid_[AMOUNT_OF_LEVELS][2] = {{0, 51}, {51, 100}, {101, 150}, {151, 200}, {201, 300}, {301, 500}}
protected

Definition at line 20 of file aqi_calculator.h.

◆ pm10_0_calculation_grid_

int esphome::hm3301::AQICalculator::pm10_0_calculation_grid_[AMOUNT_OF_LEVELS][2]
protected
Initial value:
= {{0, 54}, {55, 154}, {155, 254},
{255, 354}, {355, 424}, {425, 604}}

Definition at line 24 of file aqi_calculator.h.

◆ pm2_5_calculation_grid_

int esphome::hm3301::AQICalculator::pm2_5_calculation_grid_[AMOUNT_OF_LEVELS][2] = {{0, 12}, {13, 35}, {36, 55}, {56, 150}, {151, 250}, {251, 500}}
protected

Definition at line 22 of file aqi_calculator.h.


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