sen5x fix temperature compensation and gas tuning (#4901)

This commit is contained in:
matt7aylor
2023-11-22 19:48:38 +00:00
committed by GitHub
parent b809d02846
commit 8738cef5a3
3 changed files with 44 additions and 21 deletions
+9 -3
View File
@@ -201,13 +201,19 @@ void SEN5XComponent::setup() {
ESP_LOGE(TAG, "Failed to read RHT Acceleration mode");
}
}
if (this->voc_tuning_params_.has_value())
if (this->voc_tuning_params_.has_value()) {
this->write_tuning_parameters_(SEN5X_CMD_VOC_ALGORITHM_TUNING, this->voc_tuning_params_.value());
if (this->nox_tuning_params_.has_value())
delay(20);
}
if (this->nox_tuning_params_.has_value()) {
this->write_tuning_parameters_(SEN5X_CMD_NOX_ALGORITHM_TUNING, this->nox_tuning_params_.value());
delay(20);
}
if (this->temperature_compensation_.has_value())
if (this->temperature_compensation_.has_value()) {
this->write_temperature_compensation_(this->temperature_compensation_.value());
delay(20);
}
// Finally start sensor measurements
auto cmd = SEN5X_CMD_START_MEASUREMENTS_RHT_ONLY;