mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Make backup config update a callback (#138925)
This commit is contained in:
parent
ba1650bd05
commit
3d2ab3b59e
@ -154,7 +154,8 @@ class BackupConfig:
|
|||||||
self.data.retention.apply(self._manager)
|
self.data.retention.apply(self._manager)
|
||||||
self.data.schedule.apply(self._manager)
|
self.data.schedule.apply(self._manager)
|
||||||
|
|
||||||
async def update(
|
@callback
|
||||||
|
def update(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
agents: dict[str, AgentParametersDict] | UndefinedType = UNDEFINED,
|
agents: dict[str, AgentParametersDict] | UndefinedType = UNDEFINED,
|
||||||
|
@ -1870,7 +1870,7 @@ class CoreBackupReaderWriter(BackupReaderWriter):
|
|||||||
and "hassio.local" in create_backup.agent_ids
|
and "hassio.local" in create_backup.agent_ids
|
||||||
):
|
):
|
||||||
automatic_agents = [self._local_agent_id, *automatic_agents]
|
automatic_agents = [self._local_agent_id, *automatic_agents]
|
||||||
await config.update(
|
config.update(
|
||||||
create_backup=CreateBackupParametersDict(
|
create_backup=CreateBackupParametersDict(
|
||||||
agent_ids=automatic_agents,
|
agent_ids=automatic_agents,
|
||||||
include_addons=None,
|
include_addons=None,
|
||||||
|
@ -346,6 +346,7 @@ async def handle_config_info(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@callback
|
||||||
@websocket_api.require_admin
|
@websocket_api.require_admin
|
||||||
@websocket_api.websocket_command(
|
@websocket_api.websocket_command(
|
||||||
{
|
{
|
||||||
@ -387,8 +388,7 @@ async def handle_config_info(
|
|||||||
),
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@websocket_api.async_response
|
def handle_config_update(
|
||||||
async def handle_config_update(
|
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
connection: websocket_api.ActiveConnection,
|
connection: websocket_api.ActiveConnection,
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
@ -398,7 +398,7 @@ async def handle_config_update(
|
|||||||
changes = dict(msg)
|
changes = dict(msg)
|
||||||
changes.pop("id")
|
changes.pop("id")
|
||||||
changes.pop("type")
|
changes.pop("type")
|
||||||
await manager.config.update(**changes)
|
manager.config.update(**changes)
|
||||||
connection.send_result(msg["id"])
|
connection.send_result(msg["id"])
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user