Skip to content

Fix integer structs in unit tests #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025
Merged
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
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ repos:
- id: isort

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.3.0
hooks:
- id: codespell
args:
- --ignore-words-list=ser,nd,hass
- --skip="./.*"
- --quiet-level=2
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml"]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.261
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license = {text = "GPL-3.0"}
requires-python = ">=3.8"
dependencies = [
"voluptuous",
"zigpy>=0.70.0",
"zigpy>=0.80.0",
'async-timeout; python_version<"3.11"',
]

Expand Down Expand Up @@ -63,6 +63,11 @@ ignore = [
]
per-file-ignores = ["tests/*:F811,F401,F403"]

[tool.codespell]
ignore-words-list = ["IntStruct"]
skip = ["./.*", "tests/*", "pyproject.toml"]
quiet-level = 2

[tool.coverage.report]
exclude_also = [
"raise AssertionError",
Expand Down
2 changes: 1 addition & 1 deletion zigpy_deconz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
Conbee_III = 0x09


class FirmwareVersion(t.Struct, t.uint32_t):
class FirmwareVersion(t.IntStruct, t.uint32_t):
reserved: t.uint8_t
platform: FirmwarePlatform
minor: t.uint8_t
Expand Down Expand Up @@ -582,7 +582,7 @@

try:
LOGGER.debug("Sending %s%s (seq=%s)", cmd, kwargs, seq)
self._uart.send(command.replace(seq=seq).serialize())

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.12.9

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.12.9

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.12.9

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.12.9

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.13.2

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.13.2

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.13.2

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.13.2

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.9.15

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.9.15

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.9.15

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.9.15

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.10.8

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.10.8

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.10.8

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.10.8

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.11.0

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.11.0

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.11.0

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

Check warning on line 585 in zigpy_deconz/api.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.11.0

coroutine 'AsyncMockMixin._execute_mock_call' was never awaited

async with asyncio_timeout(COMMAND_TIMEOUT):
return await fut
Expand Down
1 change: 1 addition & 0 deletions zigpy_deconz/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
EUI64,
NWK,
ExtendedPanId,
IntStruct,
LongOctetString,
LVBytes,
LVList,
Expand Down