ESPHome  2024.4.1
Public Member Functions
esphome::ESPPreferences Class Referenceabstract

#include <preferences.h>

Inheritance diagram for esphome::ESPPreferences:
esphome::host::HostPreferences

Public Member Functions

virtual ESPPreferenceObject make_preference (size_t length, uint32_t type, bool in_flash)=0
 
virtual ESPPreferenceObject make_preference (size_t length, uint32_t type)=0
 
virtual bool sync ()=0
 Commit pending writes to flash. More...
 
virtual bool reset ()=0
 Forget all unsaved changes and re-initialize the permanent preferences storage. More...
 
template<typename T , enable_if_t< is_trivially_copyable< T >::value, bool > = true>
ESPPreferenceObject make_preference (uint32_t type, bool in_flash)
 
template<typename T , enable_if_t< is_trivially_copyable< T >::value, bool > = true>
ESPPreferenceObject make_preference (uint32_t type)
 

Detailed Description

Definition at line 37 of file preferences.h.

Member Function Documentation

◆ make_preference() [1/4]

virtual ESPPreferenceObject esphome::ESPPreferences::make_preference ( size_t  length,
uint32_t  type,
bool  in_flash 
)
pure virtual

◆ make_preference() [2/4]

virtual ESPPreferenceObject esphome::ESPPreferences::make_preference ( size_t  length,
uint32_t  type 
)
pure virtual

◆ make_preference() [3/4]

template<typename T , enable_if_t< is_trivially_copyable< T >::value, bool > = true>
ESPPreferenceObject esphome::ESPPreferences::make_preference ( uint32_t  type,
bool  in_flash 
)
inline

Definition at line 58 of file preferences.h.

◆ make_preference() [4/4]

template<typename T , enable_if_t< is_trivially_copyable< T >::value, bool > = true>
ESPPreferenceObject esphome::ESPPreferences::make_preference ( uint32_t  type)
inline

Definition at line 63 of file preferences.h.

◆ reset()

virtual bool esphome::ESPPreferences::reset ( )
pure virtual

Forget all unsaved changes and re-initialize the permanent preferences storage.

Usually followed by a restart which moves the system to "factory" conditions

Returns
true if operation is successful.

Implemented in esphome::host::HostPreferences.

◆ sync()

virtual bool esphome::ESPPreferences::sync ( )
pure virtual

Commit pending writes to flash.

Returns
true if write is successful.

Implemented in esphome::host::HostPreferences.


The documentation for this class was generated from the following file: