ESPHome  2024.4.1
bh1750.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace bh1750 {
9 
10 enum BH1750Mode {
14 };
15 
18  public:
19  // ========== INTERNAL METHODS ==========
20  // (In most use cases you won't need these)
21  void setup() override;
22  void dump_config() override;
23  void update() override;
24  float get_setup_priority() const override;
25 
26  protected:
27  void read_lx_(BH1750Mode mode, uint8_t mtreg, const std::function<void(float)> &f);
28 
29  uint8_t active_mtreg_{0};
30 };
31 
32 } // namespace bh1750
33 } // namespace esphome
This class implements support for the i2c-based BH1750 ambient light sensor.
Definition: bh1750.h:17
void read_lx_(BH1750Mode mode, uint8_t mtreg, const std::function< void(float)> &f)
Definition: bh1750.cpp:49
void setup() override
Definition: bh1750.cpp:40
This class simplifies creating components that periodically check a state.
Definition: component.h:283
void update() override
Definition: bh1750.cpp:127
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:151
float get_setup_priority() const override
Definition: bh1750.cpp:166
void dump_config() override
Definition: bh1750.cpp:117
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133