Fix pmsa003i cold boot marked as failed on ESP32 et al (#7064)

This commit is contained in:
Z3LIFF 2024-07-11 00:01:14 -04:00 committed by GitHub
parent fb6c2aef59
commit fa4fbf9d73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,6 +13,15 @@ void PMSA003IComponent::setup() {
PM25AQIData data;
bool successful_read = this->read_data_(&data);
if (!successful_read) {
for (int i = 0; i < 3; i++) {
successful_read = this->read_data_(&data);
if (successful_read) {
break;
}
}
}
if (!successful_read) {
this->mark_failed();
return;