Skip to content

Commit

Permalink
Merge pull request #1011 from sabeechen/ingore-supervisor-upgrades
Browse files Browse the repository at this point in the history
Treat supervisor-only backups as upgrade backups
  • Loading branch information
sabeechen authored Apr 1, 2024
2 parents 40df7e4 + ac4fb76 commit 751a434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hassio-google-drive-backup/backup/model/habackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def ignore(self):
# Supervisor backup query API doesn't quite match the create API, if the HA config folder
# is present in a backup then the Home Assistant version is present in its details
archive_count += 1
if archive_count == 1 and self._config.get(Setting.IGNORE_UPGRADE_BACKUPS):
# Supervisor-only backups just include the supervisor version number with no other information, so we have to check for <=1
if archive_count <= 1 and self._config.get(Setting.IGNORE_UPGRADE_BACKUPS):
return True
return super().ignore()

Expand Down
2 changes: 1 addition & 1 deletion hassio-google-drive-backup/tests/test_hasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ async def test_ignore_upgrade_backup_empty(ha: HaSource, time: Time, supervisor:
backups = await ha.get()
assert len(backups) == 1
assert slug in backups
assert not backups[slug].ignore()
assert backups[slug].ignore()


@pytest.mark.asyncio
Expand Down

0 comments on commit 751a434

Please sign in to comment.