I try create custom integration which use core BackupManager.
My code:
all file (if need)
from homeassistant.components.backup import BackupManager
from homeassistant.components.backup.const import DOMAIN as BACKUP_DOMAIN
from homeassistant.core import HomeAssistant
.....
def __init__(self, hass: HomeAssistant, config: dict, unique_id=None):
self._hass = hass
.....
async def get_local_files_list(self):
""" Get list of home assistant backups """
manager: BackupManager = self._hass.data[BACKUP_DOMAIN]
backups = await manager.get_backups()
When I run this code on development HA core all works as expected, but on real homeassistant I get Exception:
File "/config/custom_components/yabackup/yad.py", line 202, in get_local_files_list
manager: BackupManager = self._hass.data[BACKUP_DOMAIN]
KeyError: 'backup'
Where my wrong?