-
-
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
Add Google Drive integration for backup #134576
base: dev
Are you sure you want to change the base?
Conversation
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.
Works as expected and LGTM. Missing test coverage should be a priority on follow-up PR.
|
||
def _convert_agent_backup_to_properties(backup: AgentBackup) -> dict[str, str]: | ||
return { | ||
k: v if k in _AGENT_BACKUP_SIMPLE_FIELDS else json.dumps(v) |
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.
This feels a little fragile, should we include a "version": "1"
as a key/value so in the future when fields change in some way, we can handle that (ie json.loads
below would fail if it's not valid JSON)
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.
I changed it to convert every field to JSON except backup_id to make it less fragile. backup_id needs to be unmodified so that we can efficiently query it without listing all backups.
LGTM - as this uses the folder ID, I'm assuming there could be a chance that someone might "accidentally" delete the folder? Does this impact integration startup / backup service? Could a backup upload "silently" fail for example? Very minor in the grand scheme of things, but I know Google's storage manager likes to recommend things to delete. |
Done. If the folder is deleted the setup fails with: |
Later this could be changed to use repair instead of reconfigure flow. |
That's a good idea. Thanks! For now I changed the quality scale to |
Lovely! Would it make sense to name the folder |
Proposed change
Add Google Drive integration. Currently it only provides a backup agent that works with the Home Assistant backup solution introduced in Home Assistant 2025.1.
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: