ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
hc8
hc8.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/sensor/sensor.h
"
5
#include "
esphome/components/uart/uart.h
"
6
7
#include <cinttypes>
8
9
namespace
esphome::hc8
{
10
11
class
HC8Component
final :
public
PollingComponent
,
public
uart::UARTDevice
{
12
SUB_SENSOR(co2)
13
14
public
:
15
void
setup
()
override
;
16
void
update()
override
;
17
void
dump_config()
override
;
18
19
void
calibrate(uint16_t baseline);
20
21
void
set_warmup_seconds(
uint32_t
seconds) {
warmup_seconds_
= seconds; }
22
23
protected
:
24
uint32_t
warmup_seconds_
{0};
25
bool
warmup_complete_
{
false
};
26
};
27
28
}
// namespace esphome::hc8
esphome::Component::setup
virtual void setup()
Where the component's initialization should happen.
Definition
component.cpp:84
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:532
esphome::hc8::HC8Component
Definition
hc8.h:11
esphome::hc8::HC8Component::warmup_seconds_
uint32_t warmup_seconds_
Definition
hc8.h:24
esphome::hc8::HC8Component::warmup_complete_
bool warmup_complete_
Definition
hc8.h:25
esphome::uart::UARTDevice
Definition
uart.h:15
component.h
esphome::hc8
Definition
hc8.cpp:8
uint32_t
static void uint32_t
Definition
crash_handler.cpp:153
sensor.h
uart.h
Generated by
1.12.0