ESPHome  2024.11.0
sfa30.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace sfa30 {
9 
11  enum ErrorCode { DEVICE_MARKING_READ_FAILED, MEASUREMENT_INIT_FAILED, UNKNOWN };
12 
13  public:
14  float get_setup_priority() const override { return setup_priority::DATA; }
15  void setup() override;
16  void dump_config() override;
17  void update() override;
18 
19  void set_formaldehyde_sensor(sensor::Sensor *formaldehyde) { this->formaldehyde_sensor_ = formaldehyde; }
20  void set_humidity_sensor(sensor::Sensor *humidity) { this->humidity_sensor_ = humidity; }
22 
23  protected:
24  char device_marking_[32] = {0};
25 
26  ErrorCode error_code_{UNKNOWN};
27 
31 };
32 
33 } // namespace sfa30
34 } // namespace esphome
void set_temperature_sensor(sensor::Sensor *temperature)
Definition: sfa30.h:21
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
void set_formaldehyde_sensor(sensor::Sensor *formaldehyde)
Definition: sfa30.h:19
void dump_config() override
Definition: sfa30.cpp:41
void set_humidity_sensor(sensor::Sensor *humidity)
Definition: sfa30.h:20
sensor::Sensor * temperature_sensor_
Definition: sfa30.h:30
uint16_t temperature
Definition: sun_gtil2.cpp:26
void setup() override
Definition: sfa30.cpp:13
Implementation of a i2c functions for Sensirion sensors Sensirion data requires crc checking...
Definition: i2c_sensirion.h:17
sensor::Sensor * formaldehyde_sensor_
Definition: sfa30.h:28
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
float get_setup_priority() const override
Definition: sfa30.h:14
Base-class for all sensors.
Definition: sensor.h:57
void update() override
Definition: sfa30.cpp:64
sensor::Sensor * humidity_sensor_
Definition: sfa30.h:29