mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Fix pmsa003i cold boot marked as failed on ESP32 et al (#7064)
This commit is contained in:
parent
d1bfad9890
commit
114476d8b1
1 changed files with 9 additions and 0 deletions
|
@ -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 a new issue