Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper GPDF handling, forward to ZGP controller in application #235

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion zigpy_deconz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
Struct,
ZigbeePacket,
)
from zigpy.zgp.types import (
GPDataFrame,
)
from zigpy.zdo.types import SimpleDescriptor

from zigpy_deconz.exception import APIException, CommandError
Expand Down Expand Up @@ -399,7 +402,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 +693,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