Skip to content

Commit eca876f

Browse files
committed
Proper GPDF handling, forward to ZGP controller in application
1 parent 7264e6a commit eca876f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

zigpy_deconz/api.py

+15-1
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,
@@ -398,7 +400,7 @@ class Command(Struct):
398400
"status": Status,
399401
"frame_length": t.uint16_t,
400402
"payload_length": t.uint16_t,
401-
"reserved": t.LongOctetString,
403+
"gp_data_frame": GPDataFrame
402404
},
403405
),
404406
}
@@ -689,6 +691,18 @@ async def _data_poller(self):
689691
status=rsp["status"], device_state=rsp["device_state"]
690692
)
691693

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

0 commit comments

Comments
 (0)