Revert "Move backup/* WS commands to the backup integration" (#111136)
Revert "Move backup/* WS commands to the backup integration (#110651)"
This reverts commit ec4e6c3a74
.
This commit is contained in:
parent
8bf0466151
commit
8f83426895
9 changed files with 158 additions and 467 deletions
|
@ -14,27 +14,23 @@ CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
|
|||
|
||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the Backup integration."""
|
||||
if is_hassio(hass):
|
||||
LOGGER.error(
|
||||
"The backup integration is not supported on this installation method, "
|
||||
"please remove it from your configuration"
|
||||
)
|
||||
return False
|
||||
|
||||
backup_manager = BackupManager(hass)
|
||||
hass.data[DOMAIN] = backup_manager
|
||||
|
||||
with_hassio = is_hassio(hass)
|
||||
|
||||
async_register_websocket_handlers(hass, with_hassio)
|
||||
|
||||
if with_hassio:
|
||||
if DOMAIN in config:
|
||||
LOGGER.error(
|
||||
"The backup integration is not supported on this installation method, "
|
||||
"please remove it from your configuration"
|
||||
)
|
||||
return True
|
||||
|
||||
async def async_handle_create_service(call: ServiceCall) -> None:
|
||||
"""Service handler for creating backups."""
|
||||
await backup_manager.generate_backup()
|
||||
|
||||
hass.services.async_register(DOMAIN, "create", async_handle_create_service)
|
||||
|
||||
async_register_websocket_handlers(hass)
|
||||
async_register_http_views(hass)
|
||||
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue