[am2315c] Use warning not fail during update (#8499)

This commit is contained in:
Jonathan Swoboda 2025-04-15 01:00:44 -04:00 committed by GitHub
parent ff2b93a3e4
commit 477abc05ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,7 +128,7 @@ void AM2315C::update() {
data[2] = 0x00; data[2] = 0x00;
if (this->write(data, 3) != i2c::ERROR_OK) { if (this->write(data, 3) != i2c::ERROR_OK) {
ESP_LOGE(TAG, "Write failed!"); ESP_LOGE(TAG, "Write failed!");
this->mark_failed(); this->status_set_warning();
return; return;
} }
@ -138,12 +138,12 @@ void AM2315C::update() {
uint8_t status = 0; uint8_t status = 0;
if (this->read(&status, 1) != i2c::ERROR_OK) { if (this->read(&status, 1) != i2c::ERROR_OK) {
ESP_LOGE(TAG, "Read failed!"); ESP_LOGE(TAG, "Read failed!");
this->mark_failed(); this->status_set_warning();
return; return;
} }
if ((status & 0x80) == 0x80) { if ((status & 0x80) == 0x80) {
ESP_LOGE(TAG, "HW still busy!"); ESP_LOGE(TAG, "HW still busy!");
this->mark_failed(); this->status_set_warning();
return; return;
} }
@ -151,7 +151,7 @@ void AM2315C::update() {
uint8_t data[7]; uint8_t data[7];
if (this->read(data, 7) != i2c::ERROR_OK) { if (this->read(data, 7) != i2c::ERROR_OK) {
ESP_LOGE(TAG, "Read failed!"); ESP_LOGE(TAG, "Read failed!");
this->mark_failed(); this->status_set_warning();
return; return;
} }