Skip to content

Commit

Permalink
Proper GPDF handling, forward to ZGP controller in application
Browse files Browse the repository at this point in the history
  • Loading branch information
konistehrad committed Nov 28, 2023
1 parent ecaf376 commit 0e6d7bd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion zigpy_deconz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
from asyncio import timeout as asyncio_timeout # pragma: no cover

from zigpy.config import CONF_DEVICE_PATH
import zigpy.greenpower
from zigpy.types import (
APSStatus,
Bool,
Channels,
GPDataFrame,
KeyData,
SerializableBytes,
Struct,
Expand Down Expand Up @@ -399,7 +401,7 @@ class Command(Struct):
"status": Status,
"frame_length": t.uint16_t,
"payload_length": t.uint16_t,
"reserved": t.LongOctetString,
"gp_data_frame": GPDataFrame
},
),
}
Expand Down Expand Up @@ -690,6 +692,18 @@ async def _data_poller(self):
status=rsp["status"], device_state=rsp["device_state"]
)

def _handle_zigbee_green_power(
self,
status: Status,
gp_data_frame: GPDataFrame
) -> None:
if status == Status.SUCCESS:
asyncio.ensure_future(
self._app._greenpower.handle_received_green_power_frame(gp_data_frame),
loop=asyncio.get_running_loop()
)


def _handle_device_state_changed(
self,
status: t.Status,
Expand Down

0 comments on commit 0e6d7bd

Please sign in to comment.