mirror of
https://github.com/esphome/esphome.git
synced 2026-09-24 13:34:07 +00:00
bot comments
This commit is contained in:
@@ -75,7 +75,8 @@ void SGP30Component::setup() {
|
||||
// Hash with build time and serial number
|
||||
// This ensures the baseline storage is cleared after OTA
|
||||
// Serial numbers are unique to each sensor, so multiple sensors can be used without conflict
|
||||
uint32_t hash = static_cast<uint32_t>(App.get_build_time()) ^ static_cast<uint32_t>(this->serial_number_);
|
||||
uint32_t hash = static_cast<uint32_t>(App.get_build_time()) ^ static_cast<uint32_t>(this->serial_number_) ^
|
||||
static_cast<uint32_t>(this->serial_number_ >> 32);
|
||||
this->pref_ = global_preferences->make_preference<SGP30Baselines>(hash, true);
|
||||
|
||||
if (this->store_baseline_ && this->pref_.load(&this->baselines_storage_)) {
|
||||
|
||||
@@ -60,7 +60,8 @@ void SGP4xComponent::setup() {
|
||||
// Hash with build time and serial number
|
||||
// This ensures the baseline storage is cleared after OTA
|
||||
// Serial numbers are unique to each sensor, so multiple sensors can be used without conflict
|
||||
uint32_t hash = static_cast<uint32_t>(App.get_build_time()) ^ static_cast<uint32_t>(this->serial_number_);
|
||||
uint32_t hash = static_cast<uint32_t>(App.get_build_time()) ^ static_cast<uint32_t>(this->serial_number_) ^
|
||||
static_cast<uint32_t>(this->serial_number_ >> 32);
|
||||
this->pref_ = global_preferences->make_preference<SGP4xBaselines>(hash, true);
|
||||
|
||||
if (this->pref_.load(&this->voc_baselines_storage_)) {
|
||||
|
||||
Reference in New Issue
Block a user