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 | |
Class to help storing data. The store manager is used to cache and manage storage files.
Definition at line 106 of file storage.py.
| None homeassistant.helpers.storage._StoreManager.__init__ | ( | self, | |
| HomeAssistant | hass | ||
| ) |
Initialize storage manager class.
Definition at line 112 of file storage.py.
|
private |
Cancel the cleanup of old files.
Definition at line 190 of file storage.py.
|
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.
|
private |
Schedule the cleanup of old files.
Definition at line 178 of file storage.py.
|
private |
Initialize the cache.
Definition at line 224 of file storage.py.
|
private |
Cache the keys.
Definition at line 212 of file storage.py.
| 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.
| None homeassistant.helpers.storage._StoreManager.async_initialize | ( | self | ) |
Initialize the storage manager.
Definition at line 121 of file storage.py.
| 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.
| None homeassistant.helpers.storage._StoreManager.async_preload | ( | self, | |
| Iterable[str] | keys | ||
| ) |
Cache the keys.
Definition at line 206 of file storage.py.
|
private |
Definition at line 180 of file storage.py.
|
private |
Definition at line 227 of file storage.py.
|
private |
Definition at line 114 of file storage.py.