Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.12"
- uses: pre-commit/[email protected]

test:
strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
- "3.14"
runs-on: ubuntu-latest
steps:
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.11"
python-version: "3.12"
activate-environment: true
- name: Build package
run: uv build
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
args:
- --fix
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.18.2
hooks:
- id: mypy
exclude: cli.py
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[mypy]
python_version = 3.12
check_untyped_defs = True

[mypy-construct]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "python-roborock"
version = "3.3.2"
description = "A package to control Roborock vacuums."
authors = [{ name = "humbertogontijo", email = "[email protected]" }, {name="Lash-L"}, {name="allenporter"}]
requires-python = ">=3.11, <4"
requires-python = ">=3.12, <4"
readme = "README.md"
license = "GPL-3.0-only"
keywords = [
Expand Down
2 changes: 1 addition & 1 deletion roborock/cloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _mqtt_on_message(self, *args, **kwargs):
client, __, msg = args
try:
messages = self._decoder(msg.payload)
super().on_message_received(messages)
self.on_message_received(messages)
except Exception as ex:
self._logger.exception(ex)

Expand Down
2 changes: 1 addition & 1 deletion roborock/data/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def from_dict(cls, data: dict[str, Any]):
"""Create an instance of the class from a dictionary."""
if not isinstance(data, dict):
return None
field_types = {field.name: field.type for field in dataclasses.fields(cls)}
field_types: dict[str, type] = {field.name: field.type for field in dataclasses.fields(cls)}
result: dict[str, Any] = {}
for orig_key, value in data.items():
key = _decamelize(orig_key)
Expand Down
4 changes: 2 additions & 2 deletions roborock/devices/traits/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import logging
from dataclasses import dataclass, field, fields
from typing import Any, get_args
from typing import Any, cast, get_args

from roborock.data.containers import HomeData, HomeDataProduct, RoborockBase
from roborock.data.v1.v1_code_mappings import RoborockDockTypeCode
Expand Down Expand Up @@ -152,7 +152,7 @@ def __init__(
if (union_args := get_args(item.type)) is None or len(union_args) > 0:
continue
_LOGGER.debug("Trait '%s' is supported, initializing", item.name)
trait = item.type()
trait = cast(type, item.type)()
setattr(self, item.name, trait)
# This is a hack to allow setting the rpc_channel on all traits. This is
# used so we can preserve the dataclass behavior when the values in the
Expand Down
5 changes: 3 additions & 2 deletions roborock/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,10 @@ def _parse(self, stream, context, path):
hash1 = self.checksumfield.parse_stream(stream, **context)
hash2 = self.hashfunc(self.bytesfunc(context))
if hash1 != hash2:
hash1_out = hash1 if not isinstance(hash1, bytestringtype) else binascii.hexlify(hash1)
hash2_out = hash2 if not isinstance(hash2, bytestringtype) else binascii.hexlify(hash2)
raise ChecksumError(
f"wrong checksum, read {hash1 if not isinstance(hash1, bytestringtype) else binascii.hexlify(hash1)}, "
f"computed {hash2 if not isinstance(hash2, bytestringtype) else binascii.hexlify(hash2)}",
f"wrong checksum, read {hash1_out!r}, computed {hash2_out!r}",
path=path,
)
return hash1
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading