Skip to content

Commit e4e9f54

Browse files
committed
Remove fix for resolved zigpy Optional type bug
1 parent 588250e commit e4e9f54

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
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.20.3",
24+
"zigpy>=0.21.0",
2525
"async_timeout",
2626
"voluptuous",
2727
"coloredlogs",

zigpy_znp/zigbee/application.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,7 @@ def _receive_zdo_message(
154154
field_names, field_types = ZDO_CLUSTERS[cluster]
155155
assert set(zdo_kwargs) == set(field_names)
156156

157-
zdo_args = []
158-
159-
for f_name, f_type in zip(field_names, field_types):
160-
# XXX: bugfix for zigpy optional struct bug
161-
if f_type.__name__ == "Optional":
162-
f_type = f_type.__mro__[1]
163-
164-
zdo_args.append(f_type(zdo_kwargs[f_name]))
165-
157+
zdo_args = [t(zdo_kwargs[n]) for n, t in zip(field_names, field_types)]
166158
message = t.serialize_list([t.uint8_t(tsn)] + zdo_args)
167159

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

0 commit comments

Comments
 (0)