Skip to content

Commit 0e6d7bd

Browse files
committed
Proper GPDF handling, forward to ZGP controller in application
1 parent ecaf376 commit 0e6d7bd

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

zigpy_deconz/api.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
from asyncio import timeout as asyncio_timeout # pragma: no cover
1515

1616
from zigpy.config import CONF_DEVICE_PATH
17+
import zigpy.greenpower
1718
from zigpy.types import (
1819
APSStatus,
1920
Bool,
2021
Channels,
22+
GPDataFrame,
2123
KeyData,
2224
SerializableBytes,
2325
Struct,
@@ -399,7 +401,7 @@ class Command(Struct):
399401
"status": Status,
400402
"frame_length": t.uint16_t,
401403
"payload_length": t.uint16_t,
402-
"reserved": t.LongOctetString,
404+
"gp_data_frame": GPDataFrame
403405
},
404406
),
405407
}
@@ -690,6 +692,18 @@ async def _data_poller(self):
690692
status=rsp["status"], device_state=rsp["device_state"]
691693
)
692694

695+
def _handle_zigbee_green_power(
696+
self,
697+
status: Status,
698+
gp_data_frame: GPDataFrame
699+
) -> None:
700+
if status == Status.SUCCESS:
701+
asyncio.ensure_future(
702+
self._app._greenpower.handle_received_green_power_frame(gp_data_frame),
703+
loop=asyncio.get_running_loop()
704+
)
705+
706+
693707
def _handle_device_state_changed(
694708
self,
695709
status: t.Status,

0 commit comments

Comments
 (0)