Add PMS5003 delayed discovery

This commit is contained in:
Theo Arends 2021-08-26 11:50:15 +02:00
parent 454d4601b4
commit c17b5a6178
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,7 @@ struct PMS5003 {
uint8_t valid = 0;
uint8_t wake_mode = 1;
uint8_t ready = 1;
bool discovery_triggered = false;
} Pms;
enum PmsCommands
@ -156,6 +157,11 @@ bool PmsReadData(void)
#endif // PMS_MODEL_PMS3003
Pms.valid = 10;
if (!Pms.discovery_triggered) {
TasmotaGlobal.discovery_counter = 1; // Force discovery
Pms.discovery_triggered = true;
}
return true;
}