ESPHome  2024.5.5
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]
 
int pm2_5_calculation_grid_ [AMOUNT_OF_LEVELS][2]
 
int pm10_0_calculation_grid_ [AMOUNT_OF_LEVELS][2]
 

Static Protected Attributes

static const int AMOUNT_OF_LEVELS = 7
 

Detailed Description

Definition at line 9 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 30 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 11 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 40 of file aqi_calculator.h.

Field Documentation

◆ AMOUNT_OF_LEVELS

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

Definition at line 19 of file aqi_calculator.h.

◆ index_grid_

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

Definition at line 21 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, 504}, {505, 604}}

Definition at line 27 of file aqi_calculator.h.

◆ pm2_5_calculation_grid_

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

Definition at line 24 of file aqi_calculator.h.


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