ESPHome 2026.8.1
Loading...
Searching...
No Matches
preferences.h
Go to the documentation of this file.
1#pragma once
2#ifdef USE_LIBRETINY
3
5#include <flashdb.h>
6
7namespace esphome::libretiny {
8
9struct NVSData;
10
11class LibreTinyPreferences final : public PreferencesMixin<LibreTinyPreferences> {
12 public:
14 void open();
16 return this->make_preference(length, type);
17 }
20 bool load_from_key(uint32_t type, uint8_t *data, size_t len);
21 bool sync();
22 bool reset();
23
24 struct fdb_kvdb db;
25 struct fdb_blob blob;
26
27 protected:
29 bool is_changed_(fdb_kvdb_t db, const NVSData &to_save, const char *key_str);
30};
31
33
34} // namespace esphome::libretiny
35
36DECLARE_PREFERENCE_ALIASES(esphome::libretiny::LibreTinyPreferences)
37
38#endif // USE_LIBRETINY
CRTP mixin providing type-safe template make_preference<T>() helpers.
ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)
Definition preferences.h:15
bool load_from_key(uint32_t type, uint8_t *data, size_t len)
One-shot read of a stored preference by key, without allocating a backend.
bool is_changed_(fdb_kvdb_t db, const NVSData &to_save, const char *key_str)
LibreTinyPreferenceBackend make_backend_(uint32_t type)
uint16_t type
const void size_t len
Definition hal.h:64
static void uint32_t
uint16_t length
Definition tt21100.cpp:0