ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
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
 
- Public Member Functions inherited from esphome::hm3301::AbstractAQICalculator

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, 50}, {51, 100}, {101, 150}, {151, 200}, {201, 300}, {301, 500}}
 
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 = 6
 

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 29 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 39 of file aqi_calculator.h.

Field Documentation

◆ AMOUNT_OF_LEVELS

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

Definition at line 19 of file aqi_calculator.h.

◆ index_grid_

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

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, INT_MAX}}

Definition at line 26 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, 9}, {10, 35}, {36, 55},
{56, 125}, {126, 225}, {226, INT_MAX}}

Definition at line 23 of file aqi_calculator.h.


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