mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 05:13:31 +02:00
BH1750 Measurement time (#997)
* BH1750 Measurement time Fixes https://github.com/esphome/feature-requests/issues/148 * lint * add test Co-authored-by: Otto Winter <otto@otto-winter.com> Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
@@ -28,6 +28,7 @@ class BH1750Sensor : public sensor::Sensor, public PollingComponent, public i2c:
|
||||
* @param resolution The new resolution of the sensor.
|
||||
*/
|
||||
void set_resolution(BH1750Resolution resolution);
|
||||
void set_measurement_time(uint8_t measurement_time) { measurement_time_ = measurement_time; }
|
||||
|
||||
// ========== INTERNAL METHODS ==========
|
||||
// (In most use cases you won't need these)
|
||||
@@ -40,6 +41,7 @@ class BH1750Sensor : public sensor::Sensor, public PollingComponent, public i2c:
|
||||
void read_data_();
|
||||
|
||||
BH1750Resolution resolution_{BH1750_RESOLUTION_0P5_LX};
|
||||
uint8_t measurement_time_;
|
||||
};
|
||||
|
||||
} // namespace bh1750
|
||||
|
||||
Reference in New Issue
Block a user