diff --git a/homeassistant/components/cloud/backup.py b/homeassistant/components/cloud/backup.py index 9531604ccc7..83dc44c0ef7 100644 --- a/homeassistant/components/cloud/backup.py +++ b/homeassistant/components/cloud/backup.py @@ -8,12 +8,13 @@ from collections.abc import AsyncIterator, Callable, Coroutine, Mapping import hashlib import logging import random -from typing import Any, Literal +from typing import Any from aiohttp import ClientError from hass_nabucasa import Cloud, CloudError from hass_nabucasa.api import CloudApiNonRetryableError from hass_nabucasa.cloud_api import async_files_delete_file, async_files_list +from hass_nabucasa.files import StorageType from homeassistant.components.backup import AgentBackup, BackupAgent, BackupAgentError from homeassistant.core import HomeAssistant, callback @@ -24,7 +25,6 @@ from .client import CloudClient from .const import DATA_CLOUD, DOMAIN, EVENT_CLOUD_EVENT _LOGGER = logging.getLogger(__name__) -_STORAGE_BACKUP: Literal["backup"] = "backup" _RETRY_LIMIT = 5 _RETRY_SECONDS_MIN = 60 _RETRY_SECONDS_MAX = 600 @@ -106,7 +106,7 @@ class CloudBackupAgent(BackupAgent): try: content = await self._cloud.files.download( - storage_type=_STORAGE_BACKUP, + storage_type=StorageType.BACKUP, filename=self._get_backup_filename(), ) except CloudError as err: @@ -138,7 +138,7 @@ class CloudBackupAgent(BackupAgent): while tries <= _RETRY_LIMIT: try: await self._cloud.files.upload( - storage_type=_STORAGE_BACKUP, + storage_type=StorageType.BACKUP, open_stream=open_stream, filename=filename, base64md5hash=base64md5hash, @@ -185,7 +185,7 @@ class CloudBackupAgent(BackupAgent): try: await async_files_delete_file( self._cloud, - storage_type=_STORAGE_BACKUP, + storage_type=StorageType.BACKUP, filename=self._get_backup_filename(), ) except (ClientError, CloudError) as err: @@ -194,7 +194,9 @@ class CloudBackupAgent(BackupAgent): async def async_list_backups(self, **kwargs: Any) -> list[AgentBackup]: """List backups.""" try: - backups = await async_files_list(self._cloud, storage_type=_STORAGE_BACKUP) + backups = await async_files_list( + self._cloud, storage_type=StorageType.BACKUP + ) _LOGGER.debug("Cloud backups: %s", backups) except (ClientError, CloudError) as err: raise BackupAgentError("Failed to list backups") from err diff --git a/homeassistant/components/cloud/manifest.json b/homeassistant/components/cloud/manifest.json index 73225b5ea56..7598dde6cf3 100644 --- a/homeassistant/components/cloud/manifest.json +++ b/homeassistant/components/cloud/manifest.json @@ -13,6 +13,6 @@ "integration_type": "system", "iot_class": "cloud_push", "loggers": ["acme", "hass_nabucasa", "snitun"], - "requirements": ["hass-nabucasa==0.89.0"], + "requirements": ["hass-nabucasa==0.90.0"], "single_config_entry": true } diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 43752fb558b..5b7ad8b5118 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -34,7 +34,7 @@ fnv-hash-fast==1.2.2 go2rtc-client==0.1.2 ha-ffmpeg==3.2.2 habluetooth==3.21.1 -hass-nabucasa==0.89.0 +hass-nabucasa==0.90.0 hassil==2.2.3 home-assistant-bluetooth==1.13.1 home-assistant-frontend==20250210.0 diff --git a/pyproject.toml b/pyproject.toml index 11bda6bf1fc..64163342723 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ dependencies = [ "fnv-hash-fast==1.2.2", # hass-nabucasa is imported by helpers which don't depend on the cloud # integration - "hass-nabucasa==0.89.0", + "hass-nabucasa==0.90.0", # When bumping httpx, please check the version pins of # httpcore, anyio, and h11 in gen_requirements_all "httpx==0.28.1", diff --git a/requirements.txt b/requirements.txt index fcfdded632b..6e428a96767 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ certifi>=2021.5.30 ciso8601==2.3.2 cronsim==2.6 fnv-hash-fast==1.2.2 -hass-nabucasa==0.89.0 +hass-nabucasa==0.90.0 httpx==0.28.1 home-assistant-bluetooth==1.13.1 ifaddr==0.2.0 diff --git a/requirements_all.txt b/requirements_all.txt index f258715dd28..7b6ef5b23f8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1106,7 +1106,7 @@ habiticalib==0.3.7 habluetooth==3.21.1 # homeassistant.components.cloud -hass-nabucasa==0.89.0 +hass-nabucasa==0.90.0 # homeassistant.components.splunk hass-splunk==0.1.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 447d21630f4..436186a9edd 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -947,7 +947,7 @@ habiticalib==0.3.7 habluetooth==3.21.1 # homeassistant.components.cloud -hass-nabucasa==0.89.0 +hass-nabucasa==0.90.0 # homeassistant.components.conversation hassil==2.2.3