diff --git a/homeassistant/components/hassio/__init__.py b/homeassistant/components/hassio/__init__.py index 06dfb69b5f3..eacf5be5f9f 100644 --- a/homeassistant/components/hassio/__init__.py +++ b/homeassistant/components/hassio/__init__.py @@ -137,7 +137,7 @@ class APIEndpointSettings(NamedTuple): command: str schema: vol.Schema - timeout: int = 60 + timeout: int | None = 60 pass_data: bool = False @@ -154,37 +154,37 @@ MAP_SERVICE_API = { SERVICE_BACKUP_FULL: APIEndpointSettings( "/backups/new/full", SCHEMA_BACKUP_FULL, - 300, + None, True, ), SERVICE_BACKUP_PARTIAL: APIEndpointSettings( "/backups/new/partial", SCHEMA_BACKUP_PARTIAL, - 300, + None, True, ), SERVICE_RESTORE_FULL: APIEndpointSettings( "/backups/{slug}/restore/full", SCHEMA_RESTORE_FULL, - 300, + None, True, ), SERVICE_RESTORE_PARTIAL: APIEndpointSettings( "/backups/{slug}/restore/partial", SCHEMA_RESTORE_PARTIAL, - 300, + None, True, ), SERVICE_SNAPSHOT_FULL: APIEndpointSettings( "/backups/new/full", SCHEMA_BACKUP_FULL, - 300, + None, True, ), SERVICE_SNAPSHOT_PARTIAL: APIEndpointSettings( "/backups/new/partial", SCHEMA_BACKUP_PARTIAL, - 300, + None, True, ), } @@ -418,7 +418,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa: hass.data[DOMAIN] = hassio = HassIO(hass.loop, websession, host) if not await hassio.is_connected(): - _LOGGER.warning("Not connected with Hass.io / system too busy!") + _LOGGER.warning("Not connected with the supervisor / system too busy!") store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY) data = await store.async_load() @@ -520,8 +520,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa: payload=payload, timeout=api_endpoint.timeout, ) - except HassioAPIError as err: - _LOGGER.error("Error on Supervisor API: %s", err) + except HassioAPIError: + # The exceptions are logged properly in hassio.send_command + pass for service, settings in MAP_SERVICE_API.items(): hass.services.async_register( diff --git a/tests/components/hassio/test_init.py b/tests/components/hassio/test_init.py index 5af9908de3a..6e62545ec68 100644 --- a/tests/components/hassio/test_init.py +++ b/tests/components/hassio/test_init.py @@ -287,7 +287,7 @@ async def test_warn_when_cannot_connect(hass, caplog): assert result assert hass.components.hassio.is_hassio() - assert "Not connected with Hass.io / system too busy!" in caplog.text + assert "Not connected with the supervisor / system too busy!" in caplog.text async def test_service_register(hassio_env, hass):