mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Add exclude DB option to backup service call (#101958)
This commit is contained in:
parent
721c45b7a3
commit
c8007b841b
@ -64,6 +64,7 @@ from .const import (
|
|||||||
ATTR_COMPRESSED,
|
ATTR_COMPRESSED,
|
||||||
ATTR_FOLDERS,
|
ATTR_FOLDERS,
|
||||||
ATTR_HOMEASSISTANT,
|
ATTR_HOMEASSISTANT,
|
||||||
|
ATTR_HOMEASSISTANT_EXCLUDE_DATABASE,
|
||||||
ATTR_INPUT,
|
ATTR_INPUT,
|
||||||
ATTR_LOCATION,
|
ATTR_LOCATION,
|
||||||
ATTR_PASSWORD,
|
ATTR_PASSWORD,
|
||||||
@ -193,6 +194,7 @@ SCHEMA_BACKUP_FULL = vol.Schema(
|
|||||||
vol.Optional(ATTR_LOCATION): vol.All(
|
vol.Optional(ATTR_LOCATION): vol.All(
|
||||||
cv.string, lambda v: None if v == "/backup" else v
|
cv.string, lambda v: None if v == "/backup" else v
|
||||||
),
|
),
|
||||||
|
vol.Optional(ATTR_HOMEASSISTANT_EXCLUDE_DATABASE): cv.boolean,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ ATTR_ENDPOINT = "endpoint"
|
|||||||
ATTR_FOLDERS = "folders"
|
ATTR_FOLDERS = "folders"
|
||||||
ATTR_HEALTHY = "healthy"
|
ATTR_HEALTHY = "healthy"
|
||||||
ATTR_HOMEASSISTANT = "homeassistant"
|
ATTR_HOMEASSISTANT = "homeassistant"
|
||||||
|
ATTR_HOMEASSISTANT_EXCLUDE_DATABASE = "homeassistant_exclude_database"
|
||||||
ATTR_INPUT = "input"
|
ATTR_INPUT = "input"
|
||||||
ATTR_ISSUES = "issues"
|
ATTR_ISSUES = "issues"
|
||||||
ATTR_METHOD = "method"
|
ATTR_METHOD = "method"
|
||||||
|
@ -58,12 +58,20 @@ backup_full:
|
|||||||
example: my_backup_mount
|
example: my_backup_mount
|
||||||
selector:
|
selector:
|
||||||
backup_location:
|
backup_location:
|
||||||
|
homeassistant_exclude_database:
|
||||||
|
default: false
|
||||||
|
selector:
|
||||||
|
boolean:
|
||||||
|
|
||||||
backup_partial:
|
backup_partial:
|
||||||
fields:
|
fields:
|
||||||
homeassistant:
|
homeassistant:
|
||||||
selector:
|
selector:
|
||||||
boolean:
|
boolean:
|
||||||
|
homeassistant_exclude_database:
|
||||||
|
default: false
|
||||||
|
selector:
|
||||||
|
boolean:
|
||||||
addons:
|
addons:
|
||||||
example: ["core_ssh", "core_samba", "core_mosquitto"]
|
example: ["core_ssh", "core_samba", "core_mosquitto"]
|
||||||
selector:
|
selector:
|
||||||
|
@ -296,6 +296,10 @@
|
|||||||
"location": {
|
"location": {
|
||||||
"name": "[%key:common::config_flow::data::location%]",
|
"name": "[%key:common::config_flow::data::location%]",
|
||||||
"description": "Name of a backup network storage to host backups."
|
"description": "Name of a backup network storage to host backups."
|
||||||
|
},
|
||||||
|
"homeassistant_exclude_database": {
|
||||||
|
"name": "Home Assistant exclude database",
|
||||||
|
"description": "Exclude the Home Assistant database file from backup"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -330,6 +334,10 @@
|
|||||||
"location": {
|
"location": {
|
||||||
"name": "[%key:common::config_flow::data::location%]",
|
"name": "[%key:common::config_flow::data::location%]",
|
||||||
"description": "[%key:component::hassio::services::backup_full::fields::location::description%]"
|
"description": "[%key:component::hassio::services::backup_full::fields::location::description%]"
|
||||||
|
},
|
||||||
|
"homeassistant_exclude_database": {
|
||||||
|
"name": "Home Assistant exclude database",
|
||||||
|
"description": "Exclude the Home Assistant database file from backup"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -585,6 +585,7 @@ async def test_service_calls(
|
|||||||
{
|
{
|
||||||
"name": "backup_name",
|
"name": "backup_name",
|
||||||
"location": "backup_share",
|
"location": "backup_share",
|
||||||
|
"homeassistant_exclude_database": True,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
@ -593,6 +594,7 @@ async def test_service_calls(
|
|||||||
assert aioclient_mock.mock_calls[-1][2] == {
|
assert aioclient_mock.mock_calls[-1][2] == {
|
||||||
"name": "backup_name",
|
"name": "backup_name",
|
||||||
"location": "backup_share",
|
"location": "backup_share",
|
||||||
|
"homeassistant_exclude_database": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user