1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Enable Ruff RUF013 (#115333)

This commit is contained in:
Sid
2024-04-10 08:55:59 +02:00
committed by GitHub
parent 7e1a5b19c4
commit 3efee10b95
28 changed files with 65 additions and 58 deletions

View File

@@ -79,7 +79,9 @@ class Client:
self.client = client
self.id = 0
async def cmd(self, cmd: str, payload: dict[str, Any] = None) -> dict[str, Any]:
async def cmd(
self, cmd: str, payload: dict[str, Any] | None = None
) -> dict[str, Any]:
"""Send a command and receive the json result."""
self.id += 1
await self.client.send_json(
@@ -93,7 +95,7 @@ class Client:
assert resp.get("id") == self.id
return resp
async def cmd_result(self, cmd: str, payload: dict[str, Any] = None) -> Any:
async def cmd_result(self, cmd: str, payload: dict[str, Any] | None = None) -> Any:
"""Send a command and parse the result."""
resp = await self.cmd(cmd, payload)
assert resp.get("success")