ESPHome 2026.5.0-dev
Loading...
Searching...
No Matches
preferences.h
Go to the documentation of this file.
1#pragma once
2#ifdef USE_ESP32
3
5
6namespace esphome::esp32 {
7
8struct NVSData;
9
10class ESP32Preferences final : public PreferencesMixin<ESP32Preferences> {
11 public:
13 void open();
15 return this->make_preference(length, type);
16 }
18 bool sync();
19 bool reset();
20
22
23 protected:
24 bool is_changed_(uint32_t nvs_handle, const NVSData &to_save, const char *key_str);
25};
26
28
29} // namespace esphome::esp32
30
31DECLARE_PREFERENCE_ALIASES(esphome::esp32::ESP32Preferences)
32
33#endif // USE_ESP32
CRTP mixin providing type-safe template make_preference<T>() helpers.
bool is_changed_(uint32_t nvs_handle, const NVSData &to_save, const char *key_str)
ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)
Definition preferences.h:14
uint16_t type
void setup_preferences()
static void uint32_t
uint16_t length
Definition tt21100.cpp:0