ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
opt3001.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::opt3001 {
8
11 public:
12 void dump_config() override;
13 void update() override;
14
15 protected:
16 // checks if one-shot is complete before reading the result and returning it
17 void read_result_(const std::function<void(float)> &f);
18 // begins a one-shot measurement
19 void read_lx_(const std::function<void(float)> &f);
20
21 bool updating_{false};
22};
23
24} // namespace esphome::opt3001
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:437
This class simplifies creating components that periodically check a state.
Definition component.h:585
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:10
void read_result_(const std::function< void(float)> &f)
Definition opt3001.cpp:32
void read_lx_(const std::function< void(float)> &f)
Definition opt3001.cpp:63
Base-class for all sensors.
Definition sensor.h:47