Skip to content

Commit 198d995

Browse files
committed
Remove in-tree bugfix for zigpy/zigpy#434
1 parent 399c18f commit 198d995

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
install_requires=[
2222
"attrs",
2323
"pyserial-asyncio",
24-
"zigpy>=0.21.0",
24+
"zigpy>=0.22.1",
2525
"async_timeout",
2626
"voluptuous",
2727
"coloredlogs",

zigpy_znp/zigbee/application.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import zigpy.profiles
1313
import zigpy.zcl.foundation
1414

15-
from zigpy.zdo.types import ZDOCmd, ZDOHeader, NodeDescriptor, CLUSTERS as ZDO_CLUSTERS
15+
from zigpy.zdo.types import ZDOCmd, ZDOHeader, CLUSTERS as ZDO_CLUSTERS
1616

1717
from zigpy.zcl import clusters
1818
from zigpy.types import ExtendedPanId, deserialize as list_deserialize
@@ -156,19 +156,7 @@ def _receive_zdo_message(
156156
field_names, field_types = ZDO_CLUSTERS[cluster]
157157
assert set(zdo_kwargs) == set(field_names)
158158

159-
# TODO: Remove this fix when https://github.com/zigpy/zigpy/pull/434 is merged
160-
zdo_args = []
161-
162-
for name, field_type in zip(field_names, field_types):
163-
zdo_arg = zdo_kwargs[name]
164-
165-
if issubclass(field_type, NodeDescriptor):
166-
# XXX: `t.Optional(NodeDescriptor).__init__` doesn't work well
167-
assert isinstance(zdo_arg, NodeDescriptor)
168-
zdo_args.append(zdo_arg)
169-
else:
170-
zdo_args.append(field_type(zdo_arg))
171-
159+
zdo_args = [t(zdo_kwargs[n]) for n, t in zip(field_names, field_types)]
172160
message = t.serialize_list([t.uint8_t(tsn)] + zdo_args)
173161

174162
LOGGER.trace("Pretending we received a ZDO message: %s", message)

0 commit comments

Comments
 (0)