mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Delay deprecation checks until Home Assistant is fully initialized
This aims to delay the async_get_system_info() call until the hassio integration is fully initialized, to make sure the installation method is determined correctly.
This commit is contained in:
@ -17,6 +17,7 @@ from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
ATTR_LATITUDE,
|
||||
ATTR_LONGITUDE,
|
||||
EVENT_HOMEASSISTANT_STARTED,
|
||||
RESTART_EXIT_CODE,
|
||||
SERVICE_RELOAD,
|
||||
SERVICE_SAVE_PERSISTENT_STATES,
|
||||
@ -25,6 +26,7 @@ from homeassistant.const import (
|
||||
SERVICE_TURN_ON,
|
||||
)
|
||||
from homeassistant.core import (
|
||||
Event,
|
||||
HomeAssistant,
|
||||
ServiceCall,
|
||||
ServiceResponse,
|
||||
@ -404,6 +406,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:
|
||||
hass.data[DATA_EXPOSED_ENTITIES] = exposed_entities
|
||||
async_set_stop_handler(hass, _async_stop)
|
||||
|
||||
async def _async_check_deprecation(event: Event) -> None:
|
||||
"""Check and create deprecation issues after startup."""
|
||||
info = await async_get_system_info(hass)
|
||||
|
||||
installation_type = info["installation_type"][15:]
|
||||
@ -444,6 +448,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:
|
||||
},
|
||||
)
|
||||
|
||||
# Delay deprecation check to make sure installation method is determined correctly
|
||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STARTED, _async_check_deprecation)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user