mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
BH1750: Fix a too high default H-res2 mode value (#2536)
This commit is contained in:
parent
7e54f97003
commit
696643d037
1 changed files with 3 additions and 0 deletions
|
@ -79,6 +79,9 @@ void BH1750Sensor::read_data_() {
|
|||
|
||||
float lx = float(raw_value) / 1.2f;
|
||||
lx *= 69.0f / this->measurement_duration_;
|
||||
if (this->resolution_ == BH1750_RESOLUTION_0P5_LX) {
|
||||
lx /= 2.0f;
|
||||
}
|
||||
ESP_LOGD(TAG, "'%s': Got illuminance=%.1flx", this->get_name().c_str(), lx);
|
||||
this->publish_state(lx);
|
||||
this->status_clear_warning();
|
||||
|
|
Loading…
Reference in a new issue