mirror of
https://github.com/esphome/esphome.git
synced 2024-11-13 10:25:03 +01:00
Fix pmsa003i cold boot marked as failed on ESP32 et al (#7064)
This commit is contained in:
parent
d1bfad9890
commit
114476d8b1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user