ESPHome
2025.9.0-dev
Loading...
Searching...
No Matches
esphome
components
grove_gas_mc_v2
grove_gas_mc_v2.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/i2c/i2c.h
"
4
#include "
esphome/components/sensor/sensor.h
"
5
#include "
esphome/core/component.h
"
6
#include "
esphome/core/preferences.h
"
7
8
namespace
esphome
{
9
namespace
grove_gas_mc_v2 {
10
11
class
GroveGasMultichannelV2Component
:
public
PollingComponent
,
public
i2c::I2CDevice
{
12
SUB_SENSOR(tvoc)
13
SUB_SENSOR(carbon_monoxide)
14
SUB_SENSOR(nitrogen_dioxide)
15
SUB_SENSOR(ethanol)
16
17
public
:
19
void
setup
()
override
;
21
void
update()
override
;
22
23
void
dump_config()
override
;
24
25
protected
:
26
enum
ErrorCode
{
27
UNKNOWN
,
28
COMMUNICATION_FAILED
,
29
APP_INVALID
,
30
APP_START_FAILED
,
31
} error_code_{
UNKNOWN
};
32
33
bool
read_sensor_
(uint8_t
address
,
sensor::Sensor
*sensor);
34
};
35
36
}
// namespace grove_gas_mc_v2
37
}
// namespace esphome
address
uint8_t address
Definition
bl0906.h:4
esphome::Component::setup
virtual void setup()
Where the component's initialization should happen.
Definition
component.cpp:85
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:425
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component
Definition
grove_gas_mc_v2.h:11
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::read_sensor_
bool read_sensor_(uint8_t address, sensor::Sensor *sensor)
Definition
grove_gas_mc_v2.cpp:20
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::UNKNOWN
enum esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::ErrorCode UNKNOWN
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::ErrorCode
ErrorCode
Definition
grove_gas_mc_v2.h:26
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::APP_START_FAILED
@ APP_START_FAILED
Definition
grove_gas_mc_v2.h:30
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::COMMUNICATION_FAILED
@ COMMUNICATION_FAILED
Definition
grove_gas_mc_v2.h:28
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::UNKNOWN
@ UNKNOWN
Definition
grove_gas_mc_v2.h:27
esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::APP_INVALID
@ APP_INVALID
Definition
grove_gas_mc_v2.h:29
esphome::i2c::I2CDevice
This Class provides the methods to read/write bytes from/to an i2c device.
Definition
i2c.h:133
esphome::sensor::Sensor
Base-class for all sensors.
Definition
sensor.h:59
component.h
preferences.h
i2c.h
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
sensor.h
Generated by
1.12.0