ESPHome 2026.5.0
Loading...
Searching...
No Matches
sen0321.h
Go to the documentation of this file.
1#pragma once
2
6
7// ref:
8// https://github.com/DFRobot/DFRobot_OzoneSensor
9
11// Sensor Mode
12// While passive is supposedly supported, it does not appear to work reliably.
13static const uint8_t SENSOR_MODE_REGISTER = 0x03;
14static const uint8_t SENSOR_MODE_AUTO = 0x00;
15static const uint8_t SENSOR_MODE_PASSIVE = 0x01;
16static const uint8_t SET_REGISTER = 0x04;
17
18// Each register is 2 wide, so 0x07-0x08 for passive, or 0x09-0x0A for auto
19// First register is high bits, next low.
20static const uint8_t SENSOR_PASS_READ_REG = 0x07;
21static const uint8_t SENSOR_AUTO_READ_REG = 0x09;
22
24 public:
25 void update() override;
26 void dump_config() override;
27 void setup() override;
28
29 protected:
30 void read_data_();
31};
32
33} // namespace esphome::sen0321_sensor
This class simplifies creating components that periodically check a state.
Definition component.h:602
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
Base-class for all sensors.
Definition sensor.h:47