1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Migrate issue registry to use singleton helper (#117848)

* Migrate issue registry to use singleton helper

The other registries were already migrated, but since this
one had a read only flag, it required a slightly different
solution since it uses the same hass.data key

* refactor
This commit is contained in:
J. Nick Koston
2024-05-22 08:13:19 -10:00
committed by GitHub
parent 7a6b107248
commit 0d5c8e30cd
2 changed files with 23 additions and 7 deletions

View File

@@ -264,6 +264,13 @@ class Store[_T: Mapping[str, Any] | Sequence[Any]]:
"""Return the config path."""
return self.hass.config.path(STORAGE_DIR, self.key)
def make_read_only(self) -> None:
"""Make the store read-only.
This method is irreversible.
"""
self._read_only = True
async def async_load(self) -> _T | None:
"""Load data.