Skip to content

Commit

Permalink
Remove unnecessary **kwargs from backup API (#131124)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored Nov 21, 2024
1 parent 883382d commit ce03a98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
17 changes: 5 additions & 12 deletions homeassistant/components/backup/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ async def async_restore_backup(
*,
agent_id: str,
password: str | None,
**kwargs: Any,
) -> None:
"""Restore a backup."""

Expand Down Expand Up @@ -181,7 +180,7 @@ async def _add_platform(
self._add_platform_pre_post_handler(integration_domain, platform)
await self._async_add_platform_agents(integration_domain, platform)

async def async_pre_backup_actions(self, **kwargs: Any) -> None:
async def async_pre_backup_actions(self) -> None:
"""Perform pre backup actions."""
pre_backup_results = await asyncio.gather(
*(
Expand All @@ -194,7 +193,7 @@ async def async_pre_backup_actions(self, **kwargs: Any) -> None:
if isinstance(result, Exception):
raise result

async def async_post_backup_actions(self, **kwargs: Any) -> None:
async def async_post_backup_actions(self) -> None:
"""Perform post backup actions."""
post_backup_results = await asyncio.gather(
*(
Expand Down Expand Up @@ -247,9 +246,7 @@ async def _async_upload_backup(
finally:
self.syncing = False

async def async_get_backups(
self, **kwargs: Any
) -> tuple[dict[str, Backup], dict[str, Exception]]:
async def async_get_backups(self) -> tuple[dict[str, Backup], dict[str, Exception]]:
"""Get backups.
Return a dictionary of Backup instances keyed by their ID.
Expand Down Expand Up @@ -288,7 +285,7 @@ async def async_get_backups(
return (backups, agent_errors)

async def async_get_backup(
self, backup_id: str, **kwargs: Any
self, backup_id: str
) -> tuple[Backup | None, dict[str, Exception]]:
"""Get a backup."""
backup: Backup | None = None
Expand Down Expand Up @@ -328,7 +325,7 @@ async def async_get_backup(

return (backup, agent_errors)

async def async_delete_backup(self, backup_id: str, **kwargs: Any) -> None:
async def async_delete_backup(self, backup_id: str) -> None:
"""Delete a backup."""
for agent in self.backup_agents.values():
await agent.async_delete_backup(backup_id)
Expand All @@ -338,7 +335,6 @@ async def async_receive_backup(
*,
agent_ids: list[str],
contents: aiohttp.BodyPartReader,
**kwargs: Any,
) -> None:
"""Receive and store a backup file from upload."""
queue: SimpleQueue[tuple[bytes, asyncio.Future[None] | None] | None] = (
Expand Down Expand Up @@ -428,7 +424,6 @@ async def async_create_backup(
name: str | None,
on_progress: Callable[[BackupProgress], None] | None,
password: str | None,
**kwargs: Any,
) -> NewBackup:
"""Initiate generating a backup.
Expand Down Expand Up @@ -498,7 +493,6 @@ async def async_restore_backup(
*,
agent_id: str,
password: str | None,
**kwargs: Any,
) -> None:
"""Initiate restoring a backup.
Expand Down Expand Up @@ -686,7 +680,6 @@ async def async_restore_backup(
*,
agent_id: str,
password: str | None,
**kwargs: Any,
) -> None:
"""Restore a backup.
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/hassio/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ async def async_restore_backup(
*,
agent_id: str,
password: str | None,
**kwargs: Any,
) -> None:
"""Restore a backup."""
await self._client.backups.partial_restore(
Expand Down

0 comments on commit ce03a98

Please sign in to comment.