Commit Graph

623 Commits (55bde60f1a5f3d7fd9e06b34a420224c734ac131)

Author SHA1 Message Date
Joost Lekkerkerker 9f7a38f189
Enable RUF022 () 2025-01-16 13:48:24 +01:00
Erik Montnemery 6cbe18ebbd
Bump securetar to 2025.1.3 ()
* Bump securetar to 2025.1.3

* Remove outdated fixture
2025-01-16 13:26:52 +01:00
Joost Lekkerkerker fc39b6792c
Enable RUF100 () 2025-01-16 13:06:33 +01:00
Erik Montnemery c408bd6aad
Bump securetar to 2025.1.2 () 2025-01-14 20:39:58 +01:00
Franck Nijhof 60bdc13c94
Drop Python 3.12 support () 2025-01-14 16:23:15 +01:00
Erik Montnemery edc7c0ff2f
Bump securetar to 2025.1.1 () 2025-01-14 13:28:43 +01:00
Joost Lekkerkerker c66176cfa5
Unignore ruff rule ISC001 () 2025-01-14 12:40:43 +01:00
Krisjanis Lejejs 6e80ad505b
Bump hass-nabucasa from 0.87.0 to 0.88.1 ()
* Bump hass-nabucasa from 0.87.0 to 0.88.0

* Bump hass-nabucasa from 0.88.0 to 0.88.1

* Fix Alexa breaking changes
2025-01-14 12:17:22 +01:00
Joost Lekkerkerker 8db63adc11
Bump ruff to 0.9.1 () 2025-01-14 11:46:12 +01:00
Michael e67a131bd9
Bump uv to 0.5.18 () 2025-01-13 09:11:46 +01:00
J. Nick Koston da30dbcfe4
Bump fnv-hash-fast to 1.1.0 () 2025-01-09 12:03:08 -10:00
J. Nick Koston 0cc586a3ac
Bump zeroconf to 0.139.0 () 2025-01-09 19:01:49 +01:00
J. Nick Koston c9d8c59b45
Bump zeroconf to 0.138.1 () 2025-01-09 10:33:24 +01:00
Allen Porter 48da88583f
Bump voluptuous openapi to 0.0.6 () 2025-01-07 19:09:11 +01:00
J. Nick Koston d1e8a2a32d
Bump zeroconf to 0.137.2 () 2025-01-07 10:44:22 +01:00
J. Nick Koston 89c73f56b1
Migrate to using aiohttp-asyncmdnsresolver for aiohttp resolver () 2025-01-06 12:06:28 -10:00
Marc Mueller e6a18357db
Update pillow to 11.1.0 () 2025-01-02 22:36:14 +01:00
Marc Mueller 15806c2af6
Update Jinja2 to 3.1.5 () 2024-12-24 13:44:09 +01:00
Franck Nijhof 771ead9d7b
Prevent imports from tests in core codebase ()
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-24 08:40:05 +01:00
Abílio Costa 53ebf84339
Add cronsim to default dependencies () 2024-12-23 21:34:36 +01:00
Franck Nijhof 8d32531bc1
Bump version to 2025.2.0dev0 () 2024-12-23 17:54:32 +01:00
Franck Nijhof 7e2d382ff4
Update aiohasupervisor to 0.2.2b5 () 2024-12-21 15:10:35 +01:00
Erik Montnemery f49111a4d9
Bump aiohasupervisor to version 0.2.2b4 ()
* Bump aiohasupervisor to version 0.2.2b4

* Update test
2024-12-20 09:23:21 -05:00
Erik Montnemery 3df992790d
Bump aiohasupervisor to version 0.2.2b3 () 2024-12-20 10:59:52 +01:00
J. Nick Koston 35601480d2
Bump aiohttp to 3.11.11 () 2024-12-18 23:48:39 +01:00
Erik Montnemery a4588c80d5
Bump aiohasupervisor to version 0.2.2b2 ()
* Bump aiohasupervisor to version 0.2.2b2

* Update test
2024-12-17 13:18:26 +01:00
Robert Resch 006b3b0e22
Bump uv to 0.5.8 () 2024-12-12 14:51:15 +01:00
Krisjanis Lejejs c18cbf5994
Bump hass-nabucasa from 0.86.0 to 0.87.0 () 2024-12-12 14:25:54 +01:00
Erik Montnemery 8e991fc92f
Merge feature branch with backup changes to dev ()
* Reapply "Make WS command backup/generate send events" ()

This reverts commit 9b8316df3f.

* MVP implementation of Backup sync agents ()

* init sync agent

* add syncing

* root import

* rename list to info and add sync state

* Add base backup class

* Revert unneded change

* adjust tests

* move to kitchen_sink

* split

* move

* Adjustments

* Adjustment

* update

* Tests

* Test unknown agent

* adjust

* Adjust for different test environments

* Change /info WS to contain a dictinary

* reorder

* Add websocket command to trigger sync from the supervisor

* cleanup

* Make mypy happier

---------

Co-authored-by: Erik <erik@montnemery.com>

* Make BackupSyncMetadata model a dataclass ()

Make backup BackupSyncMetadata model a dataclass

* Rename backup sync agent to backup agent ()

* Rename sync agent module to agent

* Rename BackupSyncAgent to BackupAgent

* Fix test typo

* Rename async_get_backup_sync_agents to async_get_backup_agents

* Rename and clean up remaining sync things

* Update kitchen sink

* Apply suggestions from code review

* Update test_manager.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Add additional options to WS command backup/generate ()

* Add additional options to WS command backup/generate

* Improve test

* Improve test

* Align parameter names in backup/agents/* WS commands ()

* Allow setting password for backups ()

* Allow setting password for backups

* use is_hassio from helpers

* move it

* Fix getting psw

* Fix restoring with psw

* Address review comments

* Improve docstring

* Adjust kitchen sink

* Adjust

---------

Co-authored-by: Erik <erik@montnemery.com>

* Export relevant names from backup integration ()

* Tweak backup agent interface ()

* Tweak backup agent interface

* Adjust kitchen_sink

* Test kitchen sink backup ()

* Test agents_list_backups

* Test agents_info

* Test agents_download

* Export Backup from manager

* Test agents_upload

* Update tests after rebase

* Use backup domain

* Remove WS command backup/upload ()

* Remove WS command backup/upload

* Disable failing kitchen_sink test

* Make local backup a backup agent ()

* Make local backup a backup agent

* Adjust

* Adjust

* Adjust

* Adjust tests

* Adjust

* Adjust

* Adjust docstring

* Adjust

* Protect members of CoreLocalBackupAgent

* Remove redundant check for file

* Make the backup.create service use the first local agent

* Add BackupAgent.async_get_backup

* Fix some TODOs

* Add support for downloading backup from a remote agent

* Fix restore

* Fix test

* Adjust kitchen_sink test

* Remove unused method BackupManager.async_get_backup_path

* Re-enable kitchen sink test

* Remove BaseBackupManager.async_upload_backup

* Support restore from remote agent

* Fix review comments

* Include backup agent error in response to WS command backup/info ()

* Adjust code related to WS command backup/info ()

* Include backup agent error in response to WS command backup/details ()

* Remove LOCAL_AGENT_ID constant from backup manager ()

* Add backup config storage ()

* Add base for backup config

* Allow updating backup config

* Test loading backup config

* Add backup config update method

* Add temporary check for BackupAgent.async_remove_backup ()

* Rename backup slug to backup_id ()

* Improve backup websocket API tests ()

* Improve backup websocket API tests

* Add missing snapshot

* Fix tests leaving files behind

* Improve backup manager backup creation tests ()

* Remove class backup.backup.LocalBackup ()

* Add agent delete backup ()

* Add backup agent delete backup

* Remove agents delete websocket command

* Update docstring

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Disable core local backup agent in hassio ()

* Rename remove backup to delete backup ()

* Rename remove backup to delete backup

* Revert "backup/delete"

* Refactor BackupManager ()

* Refactor BackupManager

* Adjust

* Adjust backup creation

* Copy in executor

* Fix BackupManager.async_get_backup ()

* Fix typo in backup tests ()

* Adjust backup NewBackup class ()

* Remove class backup.BackupUploadMetadata ()

Remove class backup.BackupMetadata

* Report backup size in bytes instead of MB ()

Co-authored-by: Robert Resch <robert@resch.dev>

* Speed up CI for feature branch ()

* Speed up CI for feature branch

* adjust

* fix

* fix

* fix

* fix

* Rename remove to delete in backup websocket type ()

* Revert "Speed up CI for feature branch" ()

Revert "Speed up CI for feature branch ()"

This reverts commit 791280506d.

* Rename class BaseBackup to AgentBackup ()

* Rename class BaseBackup to AgentBackup

* Update tests

* Speed up CI for backup feature branch ()

* Add backup platform to the hassio integration ()

* Add backup platform to the hassio integration

* Add hassio to after_dependencies of backup

* Address review comments

* Remove redundant hassio parametrization of tests

* Add tests

* Address review comments

* Bump CI cache version

* Revert "Bump CI cache version"

This reverts commit 2ab4d2b179.

* Extend backup info class AgentBackup ()

* Extend backup info class AgentBackup

* Update kitchen sink

* Update kitchen sink test

* Update kitchen sink test

* Exclude cloud and hassio from core files ()

* Remove unnecessary **kwargs from backup API ()

* Fix backup tests ()

* Freeze backup dataclasses ()

* Protect CoreLocalBackupAgent.load_backups ()

* Use backup metadata v2 in core/container backups ()

* Extend backup creation API ()

* Extend backup creation API

* Add tests

* Fix merge

* Fix merge

* Return agent errors when deleting a backup ()

* Return agent errors when deleting a backup

* Remove redundant calls to dict.keys()

* Add enum type for backup folder ()

* Add method AgentBackup.from_dict ()

* Remove WS command backup/agents/list_backups ()

* Handle backup schedule ()

* Add backup schedule handling

* Fix unrelated incorrect type annotation in test

* Clarify delay save

* Make the backup time compatible with the recorder nightly job

* Update create backup parameters

* Use typed dict for create backup parameters

* Simplify schedule state

* Group create backup parameters

* Move parameter

* Fix typo

* Use Folder model

* Handle deserialization of folders better

* Fail on attempt to include addons or folders in core backup ()

* Fix AgentBackup test ()

* Add options to WS command backup/restore ()

* Add options to WS command backup/restore

* Add tests

* Fix test

* Teach core backup to restore only database or only settings ()

* Exclude tmp_backups/*.tar from backups ()

* Add WS command backup/subscribe_events ()

* Clean up temporary directory after restoring backup ()

* Improve hassio backup agent list ()

* Include `last_automatic_backup` in reply to backup/info ()

Include last_automatic_backup in reply to backup/info

* Handle backup delete after config ()

* Handle delete after copies

* Handle delete after days

* Add some test examples

* Test config_delete_after_logic

* Test config_delete_after_copies_logic

* Test more delete after days

* Add debug logs

* Always delete the oldest backup first

* Never remove the last backup

* Clean up words

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Fix after cleaning words

* Use utcnow

* Remove duplicate guard

* Simplify sorting

* Delete backups even if there are agent errors on get backups

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Rename backup delete after to backup retention ()

* Rename backup delete after to backup retention

* Tweak

* Remove length limit on `agent_ids` when configuring backup ()

Remove length limit on agent_ids when configuring backup

* Rename backup retention_config to retention ()

* Modify backup agent API to be stream oriented ()

* Modify backup agent API to be stream oriented

* Fix tests

* Adjust after code review

* Remove no longer needed pylint override

* Improve test coverage

* Change BackupAgent API to work with AsyncIterator objects

* Don't close files in the event loop

* Don't close files in the event loop

* Fix backup manager create backup log ()

* Fix debug log level ()

* Add cloud backup agent ()

* Init cloud backup sync

* Add more metadata

* Fix typo

* Adjust to base changes

* Don't raise on list if more than one backup is available

* Adjust to base branch

* Fetch always and verify on download

* Update homeassistant/components/cloud/backup.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Adjust to base branch changes

* Not required anymore

* Workaround

* Fix blocking event loop

* Fix

* Add some tests

* some tests

* Add cloud backup delete functionality

* Enable check

* Fix ruff

* Use fixture

* Use iter_chunks instead

* Remove read

* Remove explicit export of read_backup

* Align with BackupAgent API changes

* Improve test coverage

* Improve error handling

* Adjust docstrings

* Catch aiohttp.ClientError bubbling up from hass_nabucasa

* Improve iteration

---------

Co-authored-by: Erik <erik@montnemery.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Krisjanis Lejejs <krisjanis.lejejs@gmail.com>

* Extract file receiver from `BackupManager.async_receive_backup` to util ()

* Extract file receiver from BackupManager.async_receive_backup to util

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Make sure backup directory exists ()

* Make sure backup directory exists

* Hand off directory creation to executor

* Use mkdir's exist_ok feeature

* Organize BackupManager instance attributes ()

* Don't store received backups in a TempDir ()

* Don't store received backups in a TempDir

* Fix tests

* Make sure backup directory exists

* Address review comments

* Fix tests

* Rewrite backup manager state handling ()

* Rewrite backup manager state handling

* Address review comments

* Modify backup reader/writer API to be stream oriented ()

* Internalize backup tasks ()

* Internalize backup tasks

* Update test after rebase

* Handle backup error during automatic backup ()

* Improve backup manager state logging ()

* Fix backup manager state when restore completes ()

* Remove WS command backup/agents/download ()

* Add WS command backup/generate_with_stored_settings ()

* Add WS command backup/generate_with_stored_settings

* Register the new command, add tests

* Refactor local agent backup tests ()

* Refactor test_load_backups

* Refactor test loading agents

* Refactor test_delete_backup

* Refactor test_upload

* Clean up duplicate tests

* Refactor backup manager receive tests ()

* Refactor backup manager receive tests

* Clean up

* Refactor pre and post platform tests ()

* Refactor backup pre platform test

* Refactor backup post platform test

* Bump aiohasupervisor to version 0.2.2b0 ()

* Bump aiohasupervisor to version 0.2.2b0

* Adjust tests

* Publish event when manager is idle after creating backup ()

* Handle busy backup manager when uploading backup ()

* Adjust hassio backup agent to supervisor changes ()

* Adjust hassio backup agent to supervisor changes

* Fix typo

* Refactor test for create backup with wrong parameters ()

* Refactor test not loading bad backup platforms ()

* Improve receive backup coverage ()

* Refactor initiate backup test ()

* Rename Backup to ManagerBackup ()

* Refactor backup config ()

* Refactor backup config

* Remove unnecessary condition

* Adjust tests

* Improve initiate backup test ()

* Store the time of automatic backup attempts ()

* Store the time of automatic backup attempts

* Address review comments

* Update test

* Update cloud test

* Save agent failures when creating backups ()

* Save agent failures when creating backups

* Update tests

* Store KnownBackups

* Add test

* Only clear known_backups on no error, add tests

* Address review comments

* Store known backups as a list

* Update tests

* Track all backups created with backup strategy settings ()

* Track all backups created with saved settings

* Rename

* Add explicit call to save the store

* Don't register service backup.create in HassOS installations ()

* Revert changes to action service backup.create ()

* Fix logic for cleaning up temporary backup file ()

* Fix logic for cleaning up temporary backup file

* Reduce scope of patch

* Fix with_strategy_settings info not sent over websocket ()

* Fix with_strategy_settings info not sent over websocket

* Fix kitchen sink tests

* Fix cloud and hassio tests

* Revert backup ci changes ()

Revert changes speeding up CI

* Fix revert of CI changes ()

---------

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
Co-authored-by: Krisjanis Lejejs <krisjanis.lejejs@gmail.com>
2024-12-11 21:49:34 +01:00
Franck Nijhof 988ca114a0
Update ciso8601 to v2.3.2 () 2024-12-10 09:35:01 +01:00
Joakim Sørensen 9058e00aef
Bump hass-nabucasa from 0.85.0 to 0.86.0 ()
Bump hass-nabucasa fro 0.85.0 to 0.86.0
2024-12-06 08:20:06 +01:00
J. Nick Koston edc857b365
Bump aiohttp to 3.11.10 () 2024-12-05 19:50:02 -06:00
Jeff Terrace ce11ac5ecd
Bump onvif-zeep-async to 3.1.13 ()
Bump onvif-zeep-async to 3.1.13.
2024-12-04 07:34:00 +01:00
J. Nick Koston 33db95f6be
Bump PyJWT to 2.10.1 () 2024-12-03 16:03:43 +01:00
J. Nick Koston 80f28302a1
Bump yarl to 1.18.3 ()
changelog: https://github.com/aio-libs/yarl/compare/v1.18.0...v1.18.3
2024-12-01 21:17:36 -05:00
J. Nick Koston b6458ff9b8
Bump cryptography to 44.0.0 and pyOpenSSL to 24.3.0 ()
These should be bumped together to make sure we do not
have any incompatibility issues.

> Note: The Python Cryptographic Authority strongly suggests the use of pyca/cryptography where possible. If you are using pyOpenSSL for anything other than making a TLS connection you should move to cryptography and drop your pyOpenSSL dependency.
2024-12-01 21:06:14 -05:00
J. Nick Koston c6cd7e38f7
Bump aiohttp to 3.11.9 ()
changelog: https://github.com/aio-libs/aiohttp/compare/v3.11.8...v3.11.9
2024-12-01 21:05:45 -05:00
J. Nick Koston 82e190dc4b
Bump propcache to 0.2.1 () 2024-12-01 21:37:03 +01:00
J. Nick Koston ffeefd4856
Bump SQLAlchemy to 2.0.36 ()
* Bump SQLAlchemy to 2.0.35

changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.35

* fix mocking

* adjust to .36

* remove ignored as these are now typed

* fix SQLAlchemy
2024-11-30 22:07:51 -05:00
J. Nick Koston eac6673c2b
Bump orjson to 3.10.12 ()
changelog: https://github.com/ijl/orjson/compare/3.10.11...3.10.12
2024-11-28 01:35:49 +01:00
Marc Mueller 7110df04e6
Bump version to 2025.1.0dev0 () 2024-11-27 22:32:56 +01:00
J. Nick Koston 1635074aae
Bump aiohttp to 3.11.8 () 2024-11-27 14:15:44 -06:00
Robert Resch cf74532cc6
Bump uv to 0.5.4 () 2024-11-25 21:59:20 +01:00
Sid 9e98e446a2
Bump ruff to 0.8.0 () 2024-11-22 16:53:26 +01:00
Krisjanis Lejejs d3f3fdc7ef
Bump hass-nabucasa to 0.85.0 () 2024-11-22 17:08:31 +02:00
Erik Montnemery 5fa4739e2d
Bump securetar to 2024.11.0 () 2024-11-21 19:15:37 +01:00
J. Nick Koston fd392eea31
Bump aiohttp to 3.11.7 () 2024-11-21 17:36:36 +01:00
J. Nick Koston 3550d5838d
Bump yarl to 1.18.0 () 2024-11-21 17:35:42 +01:00
J. Nick Koston 7fda534d91
Bump aiohttp to 3.11.6 () 2024-11-19 15:11:00 -06:00
J. Nick Koston 8b4983087b
Bump PyJWT to 2.10.0 ()
* Bump PyJWT to 2.10.0

changelog: https://github.com/jpadilla/pyjwt/compare/2.9.0...2.10.0

* handle new keys

* add test to verify all default options are checked for merge
2024-11-19 19:55:55 +01:00