mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 12:55:46 +01:00
Fix pmsa003i cold boot marked as failed on ESP32 et al (#7064)
This commit is contained in:
parent
fb6c2aef59
commit
fa4fbf9d73
@ -13,6 +13,15 @@ void PMSA003IComponent::setup() {
|
|||||||
PM25AQIData data;
|
PM25AQIData data;
|
||||||
bool successful_read = this->read_data_(&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) {
|
if (!successful_read) {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user