mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
Indicate database migration in /api/core/state response (#122445)
* Indicate database migration in /api/core/state response * Change API response according to review comment * Adjust API response * Update test * Add test
This commit is contained in:
@@ -20,16 +20,24 @@ class RecorderData:
|
||||
db_connected: asyncio.Future[bool] = field(default_factory=asyncio.Future)
|
||||
|
||||
|
||||
@callback
|
||||
def async_migration_in_progress(hass: HomeAssistant) -> bool:
|
||||
"""Check to see if a recorder migration is in progress."""
|
||||
if "recorder" not in hass.config.components:
|
||||
return False
|
||||
# pylint: disable-next=import-outside-toplevel
|
||||
from homeassistant.components import recorder
|
||||
|
||||
return recorder.util.async_migration_in_progress(hass)
|
||||
|
||||
|
||||
@callback
|
||||
def async_migration_is_live(hass: HomeAssistant) -> bool:
|
||||
"""Check to see if a recorder migration is live."""
|
||||
# pylint: disable-next=import-outside-toplevel
|
||||
from homeassistant.components import recorder
|
||||
|
||||
return recorder.util.async_migration_is_live(hass)
|
||||
|
||||
|
||||
@callback
|
||||
def async_initialize_recorder(hass: HomeAssistant) -> None:
|
||||
"""Initialize recorder data."""
|
||||
|
Reference in New Issue
Block a user