ESPHome
2024.10.2
esphome
esphome
components
t6615
t6615.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/core/automation.h
"
5
#include "
esphome/components/sensor/sensor.h
"
6
#include "
esphome/components/uart/uart.h
"
7
8
namespace
esphome
{
9
namespace
t6615 {
10
11
enum class
T6615Command
: uint8_t {
12
NONE
= 0,
13
GET_PPM
,
14
GET_SERIAL
,
15
GET_VERSION
,
16
GET_ELEVATION
,
17
GET_ABC
,
18
ENABLE_ABC
,
19
DISABLE_ABC
,
20
SET_ELEVATION
,
21
};
22
23
class
T6615Component
:
public
PollingComponent
,
public
uart::UARTDevice
{
24
public
:
25
float
get_setup_priority()
const override
;
26
27
void
loop
()
override
;
28
void
update()
override
;
29
void
dump_config()
override
;
30
31
void
set_co2_sensor
(
sensor::Sensor
*co2_sensor) { this->co2_sensor_ = co2_sensor; }
32
33
protected
:
34
void
query_ppm_();
35
void
send_ppm_command_();
36
37
T6615Command
command_ =
T6615Command::NONE
;
38
uint32_t command_time_ = 0;
39
40
sensor::Sensor
*co2_sensor_{
nullptr
};
41
};
42
43
}
// namespace t6615
44
}
// namespace esphome
loop
void loop()
uart.h
esphome::t6615::T6615Command::GET_ELEVATION
automation.h
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition:
component.h:283
sensor.h
esphome::t6615::T6615Command::GET_VERSION
esphome::t6615::T6615Command::SET_ELEVATION
esphome::t6615::T6615Command::DISABLE_ABC
esphome::t6615::T6615Command::GET_PPM
esphome::t6615::T6615Component::set_co2_sensor
void set_co2_sensor(sensor::Sensor *co2_sensor)
Definition:
t6615.h:31
esphome::uart::UARTDevice
Definition:
uart.h:12
esphome::t6615::T6615Command::ENABLE_ABC
esphome::t6615::T6615Command::NONE
esphome::t6615::T6615Command::GET_ABC
esphome::t6615::T6615Component
Definition:
t6615.h:23
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
esphome::t6615::T6615Command
T6615Command
Definition:
t6615.h:11
esphome::sensor::Sensor
Base-class for all sensors.
Definition:
sensor.h:57
esphome::t6615::T6615Command::GET_SERIAL
Generated by
1.8.13