Avoid call to hass.helpers.store in CategoryRegistry (#114485)

This commit is contained in:
Jan-Philipp Benecke 2024-03-30 21:15:52 +01:00 committed by GitHub
parent ef5f6829e7
commit 502231b7d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.util.ulid import ulid_now
from .registry import BaseRegistry
from .storage import Store
from .typing import UNDEFINED, EventType, UndefinedType
DATA_REGISTRY = "category_registry"
@ -46,7 +47,8 @@ class CategoryRegistry(BaseRegistry):
"""Initialize the category registry."""
self.hass = hass
self.categories: dict[str, dict[str, CategoryEntry]] = {}
self._store = hass.helpers.storage.Store(
self._store: Store[dict[str, dict[str, list[dict[str, str]]]]] = Store(
hass,
STORAGE_VERSION_MAJOR,
STORAGE_KEY,
atomic_writes=True,