Home Assistant Unofficial Reference 2024.12.1
homeassistant.backup_restore Namespace Reference

Classes

class  RestoreBackupFileContent
 

Functions

None _clear_configuration_directory (Path config_dir)
 
None _extract_backup (Path config_dir, Path backup_file_path)
 
bool restore_backup (str config_dir_path)
 
RestoreBackupFileContent|None restore_backup_file_content (Path config_dir)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
tuple KEEP_PATHS = ("backups",)
 
string RESTORE_BACKUP_FILE = ".HA_RESTORE"
 

Detailed Description

Home Assistant module to handle restoring backups.

Function Documentation

◆ _clear_configuration_directory()

None homeassistant.backup_restore._clear_configuration_directory ( Path  config_dir)
private
Delete all files and directories in the config directory except for the backups directory.

Definition at line 41 of file backup_restore.py.

◆ _extract_backup()

None homeassistant.backup_restore._extract_backup ( Path  config_dir,
Path  backup_file_path 
)
private
Extract the backup file to the config directory.

Definition at line 57 of file backup_restore.py.

◆ restore_backup()

bool homeassistant.backup_restore.restore_backup ( str  config_dir_path)
Restore the backup file if any.

Returns True if a restore backup file was found and restored, False otherwise.

Definition at line 109 of file backup_restore.py.

◆ restore_backup_file_content()

RestoreBackupFileContent | None homeassistant.backup_restore.restore_backup_file_content ( Path  config_dir)
Return the contents of the restore backup file.

Definition at line 29 of file backup_restore.py.

Variable Documentation

◆ _LOGGER

homeassistant.backup_restore._LOGGER = logging.getLogger(__name__)
private

Definition at line 19 of file backup_restore.py.

◆ KEEP_PATHS

tuple homeassistant.backup_restore.KEEP_PATHS = ("backups",)

Definition at line 17 of file backup_restore.py.

◆ RESTORE_BACKUP_FILE

string homeassistant.backup_restore.RESTORE_BACKUP_FILE = ".HA_RESTORE"

Definition at line 16 of file backup_restore.py.