mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Minor adjustment of recorder helper (#138941)
This commit is contained in:
@ -20,7 +20,7 @@ if TYPE_CHECKING:
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DOMAIN: HassKey[RecorderData] = HassKey("recorder")
|
||||
DATA_RECORDER: HassKey[RecorderData] = HassKey("recorder")
|
||||
DATA_INSTANCE: HassKey[Recorder] = HassKey("recorder_instance")
|
||||
|
||||
|
||||
@ -52,11 +52,16 @@ def async_migration_is_live(hass: HomeAssistant) -> bool:
|
||||
|
||||
@callback
|
||||
def async_initialize_recorder(hass: HomeAssistant) -> None:
|
||||
"""Initialize recorder data."""
|
||||
"""Initialize recorder data.
|
||||
|
||||
This creates the RecorderData instance stored in hass.data[DATA_RECORDER] and
|
||||
registers the basic recorder websocket API which is used by frontend to determine
|
||||
if the recorder is migrating the database.
|
||||
"""
|
||||
# pylint: disable-next=import-outside-toplevel
|
||||
from homeassistant.components.recorder.basic_websocket_api import async_setup
|
||||
|
||||
hass.data[DOMAIN] = RecorderData()
|
||||
hass.data[DATA_RECORDER] = RecorderData()
|
||||
async_setup(hass)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user