fixed ruff

This commit is contained in:
patman15
2025-01-02 10:30:23 +01:00
parent c9a27388af
commit 52f7390fc0
2 changed files with 5 additions and 2 deletions

View File

@@ -14,3 +14,6 @@ testpaths = [
"tests", "tests",
] ]
asyncio_mode = "auto" asyncio_mode = "auto"
[tool.ruff.lint]
ignore = ["T201"] # ignore for script

View File

@@ -1,4 +1,4 @@
"""Extract PowerView homekey from a G3 PowerView Gateway""" """Extract PowerView homekey from a G3 PowerView Gateway."""
import base64 import base64
import json import json
@@ -55,7 +55,7 @@ def get_shade_key(hub: str, ble_name) -> bytes:
result: dict = json.loads(shades_exec_resp.content) result: dict = json.loads(shades_exec_resp.content)
if result.get("err") != 0 or len(result.get("responses", [])) != 1: if result.get("err") != 0 or len(result.get("responses", [])) != 1:
raise IOError("Error when attempting GetShadeKey") raise OSError("Error when attempting GetShadeKey")
response: Final[bytes] = bytes.fromhex(result["responses"][0]["hex"]) response: Final[bytes] = bytes.fromhex(result["responses"][0]["hex"])
dec_resp: Final[dict[str, Any]] = decode_response(response) dec_resp: Final[dict[str, Any]] = decode_response(response)
if dec_resp["errorCode"] != 0: if dec_resp["errorCode"] != 0: