ESPHome  2024.11.1
grove_gas_mc_v2.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 namespace esphome {
9 namespace grove_gas_mc_v2 {
10 
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  float get_setup_priority() const override { return setup_priority::DATA; }
26 
27  protected:
28  enum ErrorCode {
33  } error_code_{UNKNOWN};
34 
35  bool read_sensor_(uint8_t address, sensor::Sensor *sensor);
36 };
37 
38 } // namespace grove_gas_mc_v2
39 } // namespace esphome
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
This class simplifies creating components that periodically check a state.
Definition: component.h:283
virtual void setup()
Where the component's initialization should happen.
Definition: component.cpp:48
bool read_sensor_(uint8_t address, sensor::Sensor *sensor)
enum esphome::grove_gas_mc_v2::GroveGasMultichannelV2Component::ErrorCode UNKNOWN
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
uint8_t address
Definition: bl0906.h:211
Base-class for all sensors.
Definition: sensor.h:57
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133
esphome::sensor::Sensor * sensor
Definition: statsd.h:38