Adjust the default backup name (#133668)

This commit is contained in:
Erik Montnemery 2024-12-21 09:38:59 +01:00 committed by GitHub
parent 954b6133cb
commit 82f54eb9d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 7 deletions

View File

@ -726,7 +726,10 @@ class BackupManager:
"Cannot include all addons and specify specific addons"
)
backup_name = name or f"Core {HAVERSION}"
backup_name = (
name
or f"{"Automatic" if with_automatic_settings else "Custom"} {HAVERSION}"
)
new_backup, self._backup_task = await self._reader_writer.async_create_backup(
agent_ids=agent_ids,
backup_name=backup_name,

View File

@ -2574,7 +2574,7 @@
dict({
'id': 2,
'result': dict({
'backup_job_id': '27f5c632',
'backup_job_id': 'fceef4e6',
}),
'success': True,
'type': 'result',
@ -2645,7 +2645,7 @@
dict({
'id': 2,
'result': dict({
'backup_job_id': '27f5c632',
'backup_job_id': 'fceef4e6',
}),
'success': True,
'type': 'result',
@ -2716,7 +2716,7 @@
dict({
'id': 2,
'result': dict({
'backup_job_id': '27f5c632',
'backup_job_id': 'fceef4e6',
}),
'success': True,
'type': 'result',

View File

@ -121,7 +121,7 @@ async def test_async_create_backup(
assert create_backup.called
assert create_backup.call_args == call(
agent_ids=["backup.local"],
backup_name="Core 2025.1.0",
backup_name="Custom 2025.1.0",
extra_metadata={
"instance_id": hass.data["core.uuid"],
"with_automatic_settings": False,
@ -254,7 +254,7 @@ async def test_async_initiate_backup(
ws_client = await hass_ws_client(hass)
include_database = params.get("include_database", True)
name = params.get("name", "Core 2025.1.0")
name = params.get("name", "Custom 2025.1.0")
password = params.get("password")
path_glob.return_value = []
@ -502,7 +502,7 @@ async def test_async_initiate_backup_with_agent_error(
"folders": [],
"homeassistant_included": True,
"homeassistant_version": "2025.1.0",
"name": "Core 2025.1.0",
"name": "Custom 2025.1.0",
"protected": False,
"size": 123,
"with_automatic_settings": False,