mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
Fix pmsa003i cold boot marked as failed on ESP32 et al (#7064)
This commit is contained in:
parent
fb6c2aef59
commit
fa4fbf9d73
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