Conversation
| ) | ||
|
|
||
| with tarfile.open(Path(tmp_dir, "homeassistant.tar.gz"), "w:gz") as tar: | ||
| _add_directory_to_tarfile( |
There was a problem hiding this comment.
We have a feature recently added by @agners to pause the recorder while performing a backup. We should enable that here too.
There was a problem hiding this comment.
That is planed, but is currently only triggerable with WS, so need a little refactor of the recorder integration before that can be done, which is why that is not including this PR
There was a problem hiding this comment.
ok. We should generalize that logic indeed, to require an override from the user before we shut down if a backup is in progress
|
Let's load this integration as part of |
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
| manager: BackupManager = request.app["hass"].data[DOMAIN] | ||
| backup = await manager.get_backup(slug) | ||
|
|
||
| if backup is None or not backup.path.exists(): |
There was a problem hiding this comment.
If the backup file doesn't exist, should it be removed from BackupManager._backups ?
| if data_file := backup_file.extractfile("./backup.json"): | ||
| data = json.loads(data_file.read()) | ||
| backup = Backup( |
There was a problem hiding this comment.
If an exception happens reading 1 backup, we currently don't recover. Should we log the exception and continue to next backup?
tests/components/backup/common.py
Outdated
| """Set up the Backup integration.""" | ||
| with patch( | ||
| "homeassistant.components.backup.is_hassio", return_value=with_hassio | ||
| ), patch("pathlib.Path.mkdir"): |
There was a problem hiding this comment.
You're no longer creating the backup dir during setup.
Breaking change
Proposed change
This PR adds a backup integration that can be used on installation methods that does not have a Supervisor, the backup files that are generated can be used to restore on a Home Assistant Operating System installation
Related:
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: