hassio: Add support for creating (un)compressed archives (#70819)

* hassio: Add support for creating (un)compressed archives

This is supported by hassio since version 2022.02.0, but not exposed by the
core component.

See: https://github.com/home-assistant/supervisor/pull/3378

* Update homeassistant/components/hassio/services.yaml

* Update homeassistant/components/hassio/__init__.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Marco Trevisan 2022-04-27 11:41:16 +02:00 committed by GitHub
parent df8981f7c4
commit 71529f4476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View File

@ -53,6 +53,7 @@ from .const import (
ATTR_ADDONS,
ATTR_AUTO_UPDATE,
ATTR_CHANGELOG,
ATTR_COMPRESSED,
ATTR_DISCOVERY,
ATTR_FOLDERS,
ATTR_HOMEASSISTANT,
@ -127,7 +128,11 @@ SCHEMA_ADDON_STDIN = SCHEMA_ADDON.extend(
)
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(

View File

@ -6,6 +6,7 @@ DOMAIN = "hassio"
ATTR_ADDON = "addon"
ATTR_ADDONS = "addons"
ATTR_ADMIN = "admin"
ATTR_COMPRESSED = "compressed"
ATTR_CONFIG = "config"
ATTR_DATA = "data"
ATTR_DISCOVERY = "discovery"

View File

@ -82,6 +82,12 @@ backup_full:
example: "password"
selector:
text:
compressed:
name: Compressed
description: Use compressed archives
default: true
selector:
boolean:
backup_partial:
name: Create a partial backup.
@ -116,6 +122,12 @@ backup_partial:
example: "password"
selector:
text:
compressed:
name: Compressed
description: Use compressed archives
default: true
selector:
boolean:
restore_full:
name: Restore from full backup.