Skip to content

Commit

Permalink
hassio: Add support for creating (un)compressed archives
Browse files Browse the repository at this point in the history
This is supported by hassio since version 2022.02.0, but not exposed by the
core component.

See: home-assistant/supervisor#3378
  • Loading branch information
3v1n0 committed Apr 26, 2022
1 parent 997fb7a commit 0c267cb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion homeassistant/components/hassio/__init__.py
Expand Up @@ -53,6 +53,7 @@
ATTR_ADDONS,
ATTR_AUTO_UPDATE,
ATTR_CHANGELOG,
ATTR_COMPRESSED,
ATTR_DISCOVERY,
ATTR_FOLDERS,
ATTR_HOMEASSISTANT,
Expand Down Expand Up @@ -127,14 +128,19 @@
)

SCHEMA_BACKUP_FULL = vol.Schema(
{vol.Optional(ATTR_NAME): cv.string, vol.Optional(ATTR_PASSWORD): cv.string}
{
vol.Optional(ATTR_NAME): cv.string,
vol.Optional(ATTR_PASSWORD): cv.string,
vol.Optional(ATTR_COMPRESSED): cv.boolean,
}
)

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]),
vol.Optional(ATTR_COMPRESSED): cv.boolean,
}
)

Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/hassio/const.py
Expand Up @@ -7,6 +7,7 @@
ATTR_ADDONS = "addons"
ATTR_ADMIN = "admin"
ATTR_CONFIG = "config"
ATTR_COMPRESSED = "compressed"
ATTR_DATA = "data"
ATTR_DISCOVERY = "discovery"
ATTR_ENABLE = "enable"
Expand Down
11 changes: 11 additions & 0 deletions homeassistant/components/hassio/services.yaml
Expand Up @@ -82,6 +82,11 @@ backup_full:
example: "password"
selector:
text:
compressed:
name: Compressed
description: Optionally use compressed archives (default = true)
selector:
boolean:

backup_partial:
name: Create a partial backup.
Expand Down Expand Up @@ -116,6 +121,12 @@ backup_partial:
example: "password"
selector:
text:
compressed:
name: Compressed
description: Optionally use compressed archives (default = true)
selector:
boolean:


restore_full:
name: Restore from full backup.
Expand Down

0 comments on commit 0c267cb

Please sign in to comment.