Avoid unnecessary waits to stabilize the VOC algorithm (#1834)

This commit is contained in:
Stefan Agner 2021-06-05 10:52:16 +02:00 committed by GitHub
parent ebadaa9660
commit 80ad784a4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,7 +220,8 @@ void SGP40Component::update() {
uint32_t voc_index = this->measure_voc_index_();
if (this->samples_read_++ < this->samples_to_stabalize_) {
if (this->samples_read_ < this->samples_to_stabalize_) {
this->samples_read_++;
ESP_LOGD(TAG, "Sensor has not collected enough samples yet. (%d/%d) VOC index is: %u", this->samples_read_,
this->samples_to_stabalize_, voc_index);
return;