|
12 | 12 | import zigpy.profiles
|
13 | 13 | import zigpy.zcl.foundation
|
14 | 14 |
|
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 |
16 | 16 |
|
17 | 17 | from zigpy.zcl import clusters
|
18 | 18 | from zigpy.types import ExtendedPanId, deserialize as list_deserialize
|
@@ -156,19 +156,7 @@ def _receive_zdo_message(
|
156 | 156 | field_names, field_types = ZDO_CLUSTERS[cluster]
|
157 | 157 | assert set(zdo_kwargs) == set(field_names)
|
158 | 158 |
|
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)] |
172 | 160 | message = t.serialize_list([t.uint8_t(tsn)] + zdo_args)
|
173 | 161 |
|
174 | 162 | LOGGER.trace("Pretending we received a ZDO message: %s", message)
|
|
0 commit comments