diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 92387db1..3e7bc6f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,8 +12,8 @@ repos: - id: mypy additional_dependencies: [ "httpx==0.27.2", + "orjson==3.10.12", "packaging==24.2", - "types-orjson==3.6.2", "types-xmltodict==v0.14.0.20241009" ] exclude: ^tests/ diff --git a/axis/interfaces/mqtt.py b/axis/interfaces/mqtt.py index 2a3fa834..56bfd602 100644 --- a/axis/interfaces/mqtt.py +++ b/axis/interfaces/mqtt.py @@ -25,7 +25,7 @@ DEFAULT_TOPICS = ["//."] -def mqtt_json_to_event(msg: bytes | str) -> dict[str, Any]: +def mqtt_json_to_event(msg: bytes | bytearray | memoryview | str) -> dict[str, Any]: """Convert JSON message from MQTT to event format.""" message = orjson.loads(msg) topic = message["topic"].replace("onvif", "tns1").replace("axis", "tnsaxis") diff --git a/pyproject.toml b/pyproject.toml index 8ae5c0a1..6a02085d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,6 @@ requirements-test = [ "pytest-cov==6.0.0", "respx==0.21.1", "ruff==0.8.2", - "types-orjson==3.6.2", "types-xmltodict==v0.14.0.20241009", ] requirements-dev = [