mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 12:06:26 +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
@ -71,7 +71,7 @@ void BH1750Sensor::update() {
|
|||||||
float BH1750Sensor::get_setup_priority() const { return setup_priority::DATA; }
|
float BH1750Sensor::get_setup_priority() const { return setup_priority::DATA; }
|
||||||
void BH1750Sensor::read_data_() {
|
void BH1750Sensor::read_data_() {
|
||||||
uint16_t raw_value;
|
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();
|
this->status_set_warning();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user