ESPHome
2025.2.2
Main Page
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
d
e
f
i
j
l
m
n
p
q
r
s
t
u
v
+
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
d
o
p
s
t
v
w
+
Enumerations
b
c
e
f
i
m
n
p
r
s
t
v
+
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Functions
_
a
l
m
o
s
t
u
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
Typedefs
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
esphome
esphome
components
hm3301
aqi_calculator_factory.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
caqi_calculator.h
"
4
#include "
aqi_calculator.h
"
5
6
namespace
esphome
{
7
namespace
hm3301 {
8
9
enum
AQICalculatorType
{
CAQI_TYPE
= 0,
AQI_TYPE
= 1 };
10
11
class
AQICalculatorFactory
{
12
public
:
13
AbstractAQICalculator
*
get_calculator
(
AQICalculatorType
type
) {
14
if
(type == 0) {
15
return
caqi_calculator_
;
16
}
else
if
(type == 1) {
17
return
aqi_calculator_
;
18
}
19
20
return
nullptr
;
21
}
22
23
protected
:
24
CAQICalculator
*
caqi_calculator_
=
new
CAQICalculator
();
25
AQICalculator
*
aqi_calculator_
=
new
AQICalculator
();
26
};
27
28
}
// namespace hm3301
29
}
// namespace esphome
esphome::hm3301::AQICalculatorFactory
Definition:
aqi_calculator_factory.h:11
esphome::hm3301::CAQICalculator
Definition:
caqi_calculator.h:9
caqi_calculator.h
esphome::hm3301::AQICalculatorFactory::get_calculator
AbstractAQICalculator * get_calculator(AQICalculatorType type)
Definition:
aqi_calculator_factory.h:13
esphome::hm3301::AQICalculator
Definition:
aqi_calculator.h:9
aqi_calculator.h
esphome::hm3301::CAQI_TYPE
Definition:
aqi_calculator_factory.h:9
esphome::hm3301::AbstractAQICalculator
Definition:
abstract_aqi_calculator.h:8
esphome::hm3301::AQICalculatorFactory::aqi_calculator_
AQICalculator * aqi_calculator_
Definition:
aqi_calculator_factory.h:25
type
uint8_t type
Definition:
e131_packet.cpp:135
esphome::hm3301::AQICalculatorType
AQICalculatorType
Definition:
aqi_calculator_factory.h:9
esphome::hm3301::AQICalculatorFactory::caqi_calculator_
CAQICalculator * caqi_calculator_
Definition:
aqi_calculator_factory.h:24
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::hm3301::AQI_TYPE
Definition:
aqi_calculator_factory.h:9
Generated by
1.8.13