Add homeassistant to partial backup service (#67117)

pull/67097/head^2
Joakim Sørensen 2022-02-23 17:38:52 +01:00 committed by GitHub
parent 419e683526
commit 49aabcb2ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -125,6 +125,7 @@ SCHEMA_BACKUP_FULL = vol.Schema(
SCHEMA_BACKUP_PARTIAL = SCHEMA_BACKUP_FULL.extend(
{
vol.Optional(ATTR_HOMEASSISTANT): cv.boolean,
vol.Optional(ATTR_FOLDERS): vol.All(cv.ensure_list, [cv.string]),
vol.Optional(ATTR_ADDONS): vol.All(cv.ensure_list, [cv.string]),
}

View File

@ -87,6 +87,11 @@ backup_partial:
name: Create a partial backup.
description: Create a partial backup.
fields:
homeassistant:
name: Home Assistant settings
description: Backup Home Assistant settings
selector:
boolean:
addons:
name: Add-ons
description: Optional list of add-on slugs.

View File

@ -397,12 +397,18 @@ async def test_service_calls(hassio_env, hass, aioclient_mock, caplog):
await hass.services.async_call(
"hassio",
"backup_partial",
{"addons": ["test"], "folders": ["ssl"], "password": "123456"},
{
"homeassistant": True,
"addons": ["test"],
"folders": ["ssl"],
"password": "123456",
},
)
await hass.async_block_till_done()
assert aioclient_mock.call_count == 12
assert aioclient_mock.mock_calls[-1][2] == {
"homeassistant": True,
"addons": ["test"],
"folders": ["ssl"],
"password": "123456",