|
6 | 6 | from getpass import getuser |
7 | 7 | import logging |
8 | 8 | import platform |
9 | | -from typing import TYPE_CHECKING, Any |
| 9 | +from typing import Any |
10 | 10 |
|
11 | 11 | from homeassistant.const import __version__ as current_version |
12 | 12 | from homeassistant.core import HomeAssistant |
|
15 | 15 | from homeassistant.util.system_info import is_official_image |
16 | 16 |
|
17 | 17 | from .hassio import is_hassio |
18 | | -from .importlib import async_import_module |
19 | 18 | from .singleton import singleton |
20 | 19 |
|
21 | 20 | _LOGGER = logging.getLogger(__name__) |
@@ -54,15 +53,6 @@ def _read_arch_file() -> str: |
54 | 53 | @bind_hass |
55 | 54 | async def async_get_system_info(hass: HomeAssistant) -> dict[str, Any]: |
56 | 55 | """Return info about the system.""" |
57 | | - # Local import to avoid circular dependencies |
58 | | - # We use the import helper because hassio |
59 | | - # may not be loaded yet and we don't want to |
60 | | - # do blocking I/O in the event loop to import it. |
61 | | - if TYPE_CHECKING: |
62 | | - from homeassistant.components import hassio # noqa: PLC0415 |
63 | | - else: |
64 | | - hassio = await async_import_module(hass, "homeassistant.components.hassio") |
65 | | - |
66 | 56 | is_hassio_ = is_hassio(hass) |
67 | 57 |
|
68 | 58 | info_object = { |
@@ -105,6 +95,9 @@ async def async_get_system_info(hass: HomeAssistant) -> dict[str, Any]: |
105 | 95 |
|
106 | 96 | # Enrich with Supervisor information |
107 | 97 | if is_hassio_: |
| 98 | + # Local import to avoid circular dependencies |
| 99 | + from homeassistant.components import hassio # noqa: PLC0415 |
| 100 | + |
108 | 101 | if not (info := hassio.get_info(hass)): |
109 | 102 | _LOGGER.warning("No Home Assistant Supervisor info available") |
110 | 103 | info = {} |
|
0 commit comments