Skip to content

Commit

Permalink
Remove in-tree bugfix for zigpy/zigpy#434
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Jul 12, 2020
1 parent 399c18f commit 198d995
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
install_requires=[
"attrs",
"pyserial-asyncio",
"zigpy>=0.21.0",
"zigpy>=0.22.1",
"async_timeout",
"voluptuous",
"coloredlogs",
Expand Down
16 changes: 2 additions & 14 deletions zigpy_znp/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import zigpy.profiles
import zigpy.zcl.foundation

from zigpy.zdo.types import ZDOCmd, ZDOHeader, NodeDescriptor, CLUSTERS as ZDO_CLUSTERS
from zigpy.zdo.types import ZDOCmd, ZDOHeader, CLUSTERS as ZDO_CLUSTERS

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

# TODO: Remove this fix when https://github.com/zigpy/zigpy/pull/434 is merged
zdo_args = []

for name, field_type in zip(field_names, field_types):
zdo_arg = zdo_kwargs[name]

if issubclass(field_type, NodeDescriptor):
# XXX: `t.Optional(NodeDescriptor).__init__` doesn't work well
assert isinstance(zdo_arg, NodeDescriptor)
zdo_args.append(zdo_arg)
else:
zdo_args.append(field_type(zdo_arg))

zdo_args = [t(zdo_kwargs[n]) for n, t in zip(field_names, field_types)]
message = t.serialize_list([t.uint8_t(tsn)] + zdo_args)

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

0 comments on commit 198d995

Please sign in to comment.