Skip to content

Commit 199d5c1

Browse files
authored
Fix integer structs in unit tests (#265)
* Use the zigpy `IntStruct` API * Fix codespell
1 parent 8e21fda commit 199d5c1

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ repos:
3333
- id: isort
3434

3535
- repo: https://github.com/codespell-project/codespell
36-
rev: v2.2.4
36+
rev: v2.3.0
3737
hooks:
3838
- id: codespell
39-
args:
40-
- --ignore-words-list=ser,nd,hass
41-
- --skip="./.*"
42-
- --quiet-level=2
39+
additional_dependencies: [tomli]
40+
args: ["--toml", "pyproject.toml"]
4341

4442
- repo: https://github.com/charliermarsh/ruff-pre-commit
4543
rev: v0.0.261

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ license = {text = "GPL-3.0"}
1515
requires-python = ">=3.8"
1616
dependencies = [
1717
"voluptuous",
18-
"zigpy>=0.70.0",
18+
"zigpy>=0.80.0",
1919
'async-timeout; python_version<"3.11"',
2020
]
2121

@@ -63,6 +63,11 @@ ignore = [
6363
]
6464
per-file-ignores = ["tests/*:F811,F401,F403"]
6565

66+
[tool.codespell]
67+
ignore-words-list = ["IntStruct"]
68+
skip = ["./.*", "tests/*", "pyproject.toml"]
69+
quiet-level = 2
70+
6671
[tool.coverage.report]
6772
exclude_also = [
6873
"raise AssertionError",

zigpy_deconz/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class FirmwarePlatform(t.enum8):
7878
Conbee_III = 0x09
7979

8080

81-
class FirmwareVersion(t.Struct, t.uint32_t):
81+
class FirmwareVersion(t.IntStruct, t.uint32_t):
8282
reserved: t.uint8_t
8383
platform: FirmwarePlatform
8484
minor: t.uint8_t

zigpy_deconz/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
EUI64,
77
NWK,
88
ExtendedPanId,
9+
IntStruct,
910
LongOctetString,
1011
LVBytes,
1112
LVList,

0 commit comments

Comments
 (0)