ESPHome 2026.3.0-dev
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
16 protected:
17 // checks if one-shot is complete before reading the result and returning it
18 void read_result_(const std::function<void(float)> &f);
19 // begins a one-shot measurement
20 void read_lx_(const std::function<void(float)> &f);
21
22 bool updating_{false};
23};
24
25} // namespace opt3001
26} // namespace esphome
ESPDEPRECATED("set_retry is deprecated and will be removed in 2026.8.0. Use set_timeout or set_interval instead.", "2026.2.0") void set_retry(const std uint32_t uint8_t std::function< RetryResult(uint8_t)> && f
Definition component.h:387
This class simplifies creating components that periodically check a state.
Definition component.h:527
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
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
Base-class for all sensors.
Definition sensor.h:47
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7