1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-13 14:18:14 +00:00

Merge b88508bc4307c3a1ccfdd905e406855705bcda4c into 96682f5cbefe9cd38d76adac1dcef779ee25ff7e

This commit is contained in:
Chaser Huang 2025-02-24 21:24:25 +01:00 committed by GitHub
commit 293253cba5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -79,7 +79,7 @@ void SGP30Component::setup() {
uint32_t hash = fnv1_hash(App.get_compilation_time() + std::to_string(this->serial_number_));
this->pref_ = global_preferences->make_preference<SGP30Baselines>(hash, true);
if (this->pref_.load(&this->baselines_storage_)) {
if (this->store_baseline_ && this->pref_.load(&this->baselines_storage_)) {
ESP_LOGI(TAG, "Loaded eCO2 baseline: 0x%04X, TVOC baseline: 0x%04X", this->baselines_storage_.eco2,
baselines_storage_.tvoc);
this->eco2_baseline_ = this->baselines_storage_.eco2;