Repository navigation
ZGP packet forwarding - #767
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #767 +/- ##
=======================================
Coverage 99.58% 99.59%
=======================================
Files 64 64
Lines 4350 4407 +57
=======================================
+ Hits 4332 4389 +57
Misses 18 18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unprotected GP events are dropped by zigpy, and EZSPv6 cleanup leaves existing sink entries intact.
2 open issues
What changed in this PR
Adds Green Power packet forwarding to zigpy, addressing callback parsing failures reported in #712.
Changes:
- Corrects GP address layouts and version-specific callback schemas.
- Adds incoming packet conversion, aliased sends, and GP table cleanup.
- Raises the zigpy minimum version and adds regression coverage.
| File | Description |
|---|---|
| tests/test_ezsp_v9.py | Tests captured GP callbacks. |
| tests/test_ezsp_v7.py | Tests sink-table cleanup. |
| tests/test_ezsp_v6.py | Tests aliased multicast sends. |
| tests/test_ezsp_v4.py | Tests alias support and cleanup behavior. |
| tests/test_ezsp_v19.py | Exercises captured GP frames. |
| tests/test_ezsp_v17.py | Tests GP table cleanup. |
| tests/test_ezsp_v14.py | Tests aliased sends. |
| tests/test_ezsp_v13.py | Exercises captured GP frames. |
| tests/test_application.py | Tests forwarding, security filtering, aliases, and cleanup. |
| pyproject.toml | Requires zigpy 2.4.0 or newer. |
| bellows/zigbee/application.py | Converts GP packets and forwards alias parameters. |
| bellows/types/struct.py | Corrects GP address and proxy-entry layouts. |
| bellows/types/named.py | Defines bidirectional GP flags. |
| bellows/ezsp/v7/__init__.py | Adds sink-table cleanup. |
| bellows/ezsp/v6/commands.py | Corrects aliased multicast schema. |
| bellows/ezsp/v6/__init__.py | Implements aliased multicast sends. |
| bellows/ezsp/v4/commands.py | Corrects legacy GP callback parsing. |
| bellows/ezsp/v4/__init__.py | Adds aliased broadcasts and cleanup fallback. |
| bellows/ezsp/v17/commands.py | Adjusts GP callbacks to firmware payloads. |
| bellows/ezsp/v17/__init__.py | Clears sink and proxy tables. |
| bellows/ezsp/v14/commands.py | Defines version-specific GP callback schema. |
| bellows/ezsp/v14/__init__.py | Passes alias parameters to sends. |
| bellows/ezsp/protocol.py | Extends cleanup and sending interfaces. |
Review effort: Balanced
zigpy-review-bot
left a comment
There was a problem hiding this comment.
Nice work, the EZSP side is well put together and the captured frames from v9/v13/v19 are a good basis for the parsing tests (the v13/v19 test_gpep_incoming_frame cases only check that parsing doesn't raise, so asserting not rest or a field there would make them stronger). I ran the full suite on the head with zigpy 2.4.0 (749 passed). One thing I'd fix before merging, plus two smaller ones.
Should fix
- Unprotected GPDFs are reported with
security_key_type=None, but zigpy compares it with the key type stored at commissioning and drops mismatches. Details in the inline comment onapplication.py.
Smaller
- EZSPv6 inherits the no-op
clear_gp_tables()althoughv6/commands.pydefinesgpClearSinkTable(0xE2, the same ID v7 renames togpSinkTableClearAll). Details inline onv4/__init__.py. - Unmapped GP statuses raise
KeyErrorin_handle_gp_frame. Details inline onapplication.py.
Everything else I checked holds up: the EmberGpAddress layout against the captured frames, the alias plumbing (v14+ sendBroadcast/sendMulticast, v6 sendMulticastWithAlias, v4 proxyBroadcast), and the GPPGPDLink LQI/RSSI decoding.
zigpy-review-bot
left a comment
There was a problem hiding this comment.
Both points from my earlier review are fixed at 98e5c73, and I re-ran the suite on this head with zigpy 2.4.0 (753 passed).
- Unprotected GPDFs now report
NoKey, andtest_frame_handler_gp_unprotected_devicechecks delivery to a device commissioned without security. - EZSPv6 now clears the sink table through
gpClearSinkTableand toleratesInvalidCommandError, with tests for both cases.
The new SUCCESS to SecuritySuccess mapping for pre-v14 firmware looks fine and is covered by a frame-based test. I have nothing further.

Requires zigpy/zigpy#1848.
Tested on EZSP v9, v13, and v19.
Related: #712