Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.storage._StoreManager Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass)
 
tuple[bool, json_util.JsonValueType|None]|None async_fetch (self, str key)
 
None async_initialize (self)
 
None async_invalidate (self, str key)
 
None async_preload (self, Iterable[str] keys)
 

Private Member Functions

None _async_cancel_and_cleanup (self, Event _event)
 
None _async_cleanup (self)
 
None _async_schedule_cleanup (self, Event _event)
 
None _initialize_files (self)
 
None _preload (self, Iterable[str] keys)
 

Private Attributes

 _cancel_cleanup
 
 _files
 
 _hass
 

Detailed Description

Class to help storing data.

The store manager is used to cache and manage storage files.

Definition at line 106 of file storage.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.storage._StoreManager.__init__ (   self,
HomeAssistant  hass 
)
Initialize storage manager class.

Definition at line 112 of file storage.py.

Member Function Documentation

◆ _async_cancel_and_cleanup()

None homeassistant.helpers.storage._StoreManager._async_cancel_and_cleanup (   self,
Event  _event 
)
private
Cancel the cleanup of old files.

Definition at line 190 of file storage.py.

◆ _async_cleanup()

None homeassistant.helpers.storage._StoreManager._async_cleanup (   self)
private
Cleanup unused cache.

If nothing consumes the cache 60s after startup or when we
stop Home Assistant, we'll clear the cache.

Definition at line 198 of file storage.py.

◆ _async_schedule_cleanup()

None homeassistant.helpers.storage._StoreManager._async_schedule_cleanup (   self,
Event  _event 
)
private
Schedule the cleanup of old files.

Definition at line 178 of file storage.py.

◆ _initialize_files()

None homeassistant.helpers.storage._StoreManager._initialize_files (   self)
private
Initialize the cache.

Definition at line 224 of file storage.py.

◆ _preload()

None homeassistant.helpers.storage._StoreManager._preload (   self,
Iterable[str]  keys 
)
private
Cache the keys.

Definition at line 212 of file storage.py.

◆ async_fetch()

tuple[bool, json_util.JsonValueType | None] | None homeassistant.helpers.storage._StoreManager.async_fetch (   self,
str   key 
)
Fetch data from cache.

Definition at line 142 of file storage.py.

◆ async_initialize()

None homeassistant.helpers.storage._StoreManager.async_initialize (   self)
Initialize the storage manager.

Definition at line 121 of file storage.py.

◆ async_invalidate()

None homeassistant.helpers.storage._StoreManager.async_invalidate (   self,
str  key 
)
Invalidate cache.

Store calls this when its going to save data
to ensure that the cache is not used after that.

Definition at line 131 of file storage.py.

◆ async_preload()

None homeassistant.helpers.storage._StoreManager.async_preload (   self,
Iterable[str]  keys 
)
Cache the keys.

Definition at line 206 of file storage.py.

Member Data Documentation

◆ _cancel_cleanup

homeassistant.helpers.storage._StoreManager._cancel_cleanup
private

Definition at line 180 of file storage.py.

◆ _files

homeassistant.helpers.storage._StoreManager._files
private

Definition at line 227 of file storage.py.

◆ _hass

homeassistant.helpers.storage._StoreManager._hass
private

Definition at line 114 of file storage.py.


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