-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle backup delete after config #131259
Handle backup delete after config #131259
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Some minor comments. I've not reviewed the tests yet.
return { | ||
backup_id: backup | ||
for backup_id, backup in backups.items() | ||
if dt_util.parse_datetime(backup.date, raise_on_error=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a side note: It's a bit silly to have to parse the time stamps, I think we should update the dataclass to store a datetime object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was convenient with strings when writing the tests now. 😃
I haven't checked if we use the date for anything else than this clean up at the moment.
One more comment: I think naming this feature and the related classes "backup retention" would be clearer than "backup delete after". We can always adjust that in a follow-up though if we want to get this merged. |
Co-authored-by: Erik Montnemery <erik@montnemery.com>
I'm not sure. It's quite clear when looking at the websocket command payload and it corresponds well to what we're doing: Deleting backups after either a count of days or a count of backups. |
e13a4c9
to
7d358d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MartinHjelmare 👍
Breaking change
Proposed change
Type of change
Additional information
Checklist
ruff format 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
.To help with the load of incoming pull requests: