mirror of
https://github.com/esphome/esphome.git
synced 2026-09-21 20:18:43 +00:00
[core] Encapsulate entity preference creation to prepare for hash migration (#13505)
This commit is contained in:
@@ -10,7 +10,7 @@ static const char *const TAG = "integration";
|
||||
|
||||
void IntegrationSensor::setup() {
|
||||
if (this->restore_) {
|
||||
this->pref_ = global_preferences->make_preference<float>(this->get_preference_hash());
|
||||
this->pref_ = this->make_entity_preference<float>();
|
||||
float preference_value = 0;
|
||||
this->pref_.load(&preference_value);
|
||||
this->result_ = preference_value;
|
||||
|
||||
Reference in New Issue
Block a user