12 Commits

Author SHA1 Message Date
Michael
b5117eb071
Proper handling of unavailable Synology DSM nas during backup (#140721)
* raise BackupAgentUnreachableError when NAS is unavailable

* also raise BackupAgentUnreachableError during upload when nas unavailable

* Revert "also raise BackupAgentUnreachableError during upload when nas unavailable"

This reverts commit 38877d8540aa3c61c366069dc063bb9b4d866c48.

* Revert "raise BackupAgentUnreachableError when NAS is unavailable"

This reverts commit 4d8cfae396ea3be3409ed8f4784b9e2448954a04.

* check last_update_success of  coordinator_central to get backup agents

* consider last_update_success before notify backup listeners

* add test

* use walrus :=  :)
2025-03-26 10:22:43 +01:00
Erik Montnemery
05c61b7ec3
Rename BackupManager last_non_idle_event to last_action_event (#140291)
* Rename BackupManager last_non_idle_event to last_action_event

* Update snapshots
2025-03-19 17:28:40 +01:00
Erik Montnemery
bf190a8a73
Add backup helper (#139199)
* Add backup helper

* Add hassio to stage 1

* Apply same changes to newly merged `webdav` and `azure_storage` to fix inflight conflict

* Address comments, add tests

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-02-25 10:19:41 +01:00
Michael
4ca39636e2
Backup location feature requires Synology DSM 6.0 and higher (#139106)
* the filestation api requires dsm 6.0

* fix tests
2025-02-23 13:27:14 +01:00
Erik Montnemery
27b96160e2
Adjust backup filename scheme (#137424)
* Adjust backup filename scheme

* Update tests
2025-02-05 12:02:58 +01:00
Michael
0895ac6a82
Improve backup file naming in Synology DSM backup agent (#137278)
* improve backup file naming

* use built-in suggested_filename
2025-02-04 18:20:54 +01:00
Erik Montnemery
5629b995ce
Include extra metadata in backup WS API (#137296)
* Include extra metadata in backup WS API

* Update onboarding backup view

* Update google_drive tests
2025-02-04 15:57:30 +01:00
Michael
f9cc3361e3
Don't blow up when a backup doesn't exist on Synology DSM (#136913)
* don't raise while delte not existing backup

* only raise when error ne 408
2025-02-03 17:42:30 -05:00
Erik Montnemery
b2ec72d75f
Persist backup restore status after core restart (#136838)
* Persist backup restore status after core restart

* Don't blow up if restore result file can't be removed

* Update tests
2025-01-29 16:58:33 +01:00
Erik Montnemery
9a687e7f94
Add support for per-backup agent encryption flag (#136622)
* Add support for per-backup agent encryption flag

* Adjust

* Don't attempt decrypting an unprotected backup

* Address review comments

* Add some tests

* Add fixture

* Rename fixture

* Correct condition for when we should encrypt or decrypt

* Update tests in integrations

* Improve test coverage

* Fix onedrive tests

* Add test

* Improve cipher worker shutdown

* Improve test coverage

* Fix google_drive tests

* Move inner class _CipherBackupStreamer._WorkerStatus to module scope
2025-01-29 14:04:17 +01:00
Michael
8300fd2de8
Introduce unique_id to BackupAgent (#136651)
* add unique_id to BackupAgent

* adjust tests
2025-01-28 12:06:03 +01:00
Michael
cf8409dcd2
Add backup agent to Synology DSM (#135227)
* pre-alpha state

* small type

* use ChunkAsyncStreamIterator from aiohttp_client helper

* create parent folders during upload if none exists

* check file station permissionsduring setup

* ensure backup-agents are reloaded

* adjust config flow

* fix check for availability of file station

* fix possible unbound

* add config flow tests

* fix existing tests

* add backup tests

* backup listeners are not async

* some more tests

* migrate existing config entries

* fix migration

* notify backup listeners only when needed during setup

* add backup settings to options flow

* switch back to the listener approach from the dev docs example

* add negative tests

* fix tests

* use HassKey

* fix tests

* Revert "use HassKey"

This reverts commit 71c5a4d6fa9c04b4907ff5f8df6ef7bd1737aa85.

* use hass loop call_soon instead of non-eager-start tasks

* use HassKey for backup-agent-listeners

* delete empty backup-agent-listener list from hass.data

* don't handle single file download errors

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* add more tests

* we don't have entities related to file_station api

* add more backup tests

* test unload backup agent

* revert sorting of properties

* additional use hass config location for default backup path

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-01-25 22:31:30 +01:00