1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-18 12:05:41 +00:00

Fixed libretiny preference wrongly detecting change in the data to store (#7990)

This commit is contained in:
Piotr Szulc 2025-01-13 05:31:01 +01:00 committed by Jesse Hills
parent 4b51ba3fa4
commit abdd6b232f
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -147,7 +147,7 @@ class LibreTinyPreferences : public ESPPreferences {
ESP_LOGV(TAG, "fdb_kv_get_obj('%s'): nullptr - the key might not be set yet", to_save.key.c_str()); ESP_LOGV(TAG, "fdb_kv_get_obj('%s'): nullptr - the key might not be set yet", to_save.key.c_str());
return true; return true;
} }
stored_data.data.reserve(kv.value_len); stored_data.data.resize(kv.value_len);
fdb_blob_make(&blob, stored_data.data.data(), kv.value_len); fdb_blob_make(&blob, stored_data.data.data(), kv.value_len);
size_t actual_len = fdb_kv_get_blob(db, to_save.key.c_str(), &blob); size_t actual_len = fdb_kv_get_blob(db, to_save.key.c_str(), &blob);
if (actual_len != kv.value_len) { if (actual_len != kv.value_len) {