hass-core/homeassistant/components/backup/models.py
Martin Hjelmare f99b319048
Rename backup sync agent to backup agent (#130575)
* 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>
2024-11-14 02:00:49 +01:00

28 lines
664 B
Python

"""Models for the backup integration."""
from dataclasses import asdict, dataclass
@dataclass()
class BaseBackup:
"""Base backup class."""
date: str
slug: str
size: float
name: str
def as_dict(self) -> dict:
"""Return a dict representation of this backup."""
return asdict(self)
@dataclass()
class BackupUploadMetadata:
"""Backup upload metadata."""
date: str # The date the backup was created
slug: str # The slug of the backup
size: float # The size of the backup (in bytes)
name: str # The name of the backup
homeassistant: str # The version of Home Assistant that created the backup