mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 21:44:55 +01:00
Correct I2C read() return val check in bh1750 component. (#2465)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
This commit is contained in:
parent
5461f87ff0
commit
3f2d9abfe6
1 changed files with 1 additions and 1 deletions
|
@ -71,7 +71,7 @@ void BH1750Sensor::update() {
|
|||
float BH1750Sensor::get_setup_priority() const { return setup_priority::DATA; }
|
||||
void BH1750Sensor::read_data_() {
|
||||
uint16_t raw_value;
|
||||
if (!this->read(reinterpret_cast<uint8_t *>(&raw_value), 2)) {
|
||||
if (this->read(reinterpret_cast<uint8_t *>(&raw_value), 2) != i2c::ERROR_OK) {
|
||||
this->status_set_warning();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue