ESPHome  2022.6.2
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
BedjetMode mode
BedJet operating mode.
Definition: bedjet_base.h:102
void setup() override
Definition: bh1750.cpp:40
This class simplifies creating components that periodically check a state.
Definition: component.h:266
void update() override
Definition: bh1750.cpp:127
float get_setup_priority() const override
Definition: bh1750.cpp:166
void dump_config() override
Definition: bh1750.cpp:117
Definition: a4988.cpp:4
Base-class for all sensors.
Definition: sensor.h:47