Add homeassistant to partial backup service (#67117)
parent
419e683526
commit
49aabcb2ac
|
@ -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]),
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue