Skip to content

Commit

Permalink
Use new zigpy ZCL attribute data types (#3324)
Browse files Browse the repository at this point in the history
* Use new zigpy ZCL attribute data types

* Bump minimum zigpy version

* Bump zigpy in `requirements_test.txt`
  • Loading branch information
puddly authored Aug 28, 2024
1 parent dfab1cc commit 4c3729b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
license = {text = "Apache License Version 2.0"}
requires-python = ">=3.12"
dependencies = [
"zigpy>=0.65.2",
"zigpy>=0.66.0",
]

[tool.setuptools.packages.find]
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ pytest-sugar
pytest-timeout
pytest-asyncio
pytest>=7.1.3
zigpy>=0.65.3
zigpy>=0.66.0
ruff==0.0.261
5 changes: 3 additions & 2 deletions tests/test_danfoss.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from unittest import mock

from zigpy.quirks import CustomCluster
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.hvac import Thermostat
from zigpy.zcl.foundation import WriteAttributesStatusRecord, ZCLAttributeDef
Expand Down Expand Up @@ -161,8 +162,8 @@ async def test_customized_standardcluster(zigpy_device_from_quirk):
) == [[4545, 345], [5433, 45355]]

mock_attributes = {
656: ZCLAttributeDef(is_manufacturer_specific=True),
56454: ZCLAttributeDef(is_manufacturer_specific=False),
656: ZCLAttributeDef(type=t.uint8_t, is_manufacturer_specific=True),
56454: ZCLAttributeDef(type=t.uint8_t, is_manufacturer_specific=False),
}

danfoss_thermostat_cluster.attributes = mock_attributes
Expand Down
4 changes: 2 additions & 2 deletions tests/test_xiaomi.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,9 @@ async def test_aqara_feeder_write_attrs(

expected_attr_def = opple_cluster.find_attribute(0xFFF1)
expected = foundation.Attribute(0xFFF1, foundation.TypeValue())
expected.value.type = foundation.DATA_TYPES.pytype_to_datatype_id(
expected.value.type = foundation.DataType.from_python_type(
expected_attr_def.type
)
).type_id
expected.value.value = expected_attr_def.type(expected_bytes)

await opple_cluster.write_attributes({attribute: value}, manufacturer=0x115F)
Expand Down

0 comments on commit 4c3729b

Please sign in to comment.