ESPHome 2025.7.1
Loading...
Searching...
No Matches
opt3001.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace opt3001 {
9
12 public:
13 void dump_config() override;
14 void update() override;
15 float get_setup_priority() const override;
16
17 protected:
18 // checks if one-shot is complete before reading the result and returning it
19 void read_result_(const std::function<void(float)> &f);
20 // begins a one-shot measurement
21 void read_lx_(const std::function<void(float)> &f);
22
23 bool updating_{false};
24};
25
26} // namespace opt3001
27} // namespace esphome
This class simplifies creating components that periodically check a state.
Definition component.h:422
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
This class implements support for the i2c-based OPT3001 ambient light sensor.
Definition opt3001.h:11
void read_result_(const std::function< void(float)> &f)
Definition opt3001.cpp:33
void read_lx_(const std::function< void(float)> &f)
Definition opt3001.cpp:64
float get_setup_priority() const override
Definition opt3001.cpp:119
Base-class for all sensors.
Definition sensor.h:62
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7