Skip to content

Add support for the aps_encrypted bit - #8

Open
puddly wants to merge 6 commits into
devfrom
puddly/aps-encrypted-passthrough
Open

puddly wants to merge 6 commits into
devfrom
puddly/aps-encrypted-passthrough

Conversation

@puddly

@puddly puddly commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

The aps_encrypted bit is set by Ziggurat when an incoming frame was encrypted by the device. Zigpy can react to this information to send back an encrypted reply.

The wire format has changed ever so slightly and Ziggurat no longer handles aps_seq so this PR is ever so slightly larger than necessary for this one change.

Copilot AI lite review requested due to automatic review settings September 27, 2026 23:20
@codecov

codecov Bot commented Sep 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2e209a1) to head (2dcc3ce).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev        #8   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines         1185      1187    +2     
=========================================
+ Hits          1185      1187    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Local ZDO responses do not yet propagate APS_Encryption to emitted replies.

Review effort: Lite
Findings: None

What changed in this PR

Adds aps_encrypted support so encrypted incoming Zigbee frames can request encrypted replies, while removing Ziggurat-managed aps_seq handling.

Changes:

  • Adds APS encryption metadata to received frames.
  • Propagates encryption state to transmit options.
  • Updates wire builders and tests for the revised format.
File Description
zigpy_ziggurat/​zigbee/​wire.py Updates wire structures and encryption bitfields.
zigpy_ziggurat/​zigbee/​protocol.py Adjusts builders for the revised wire format.
zigpy_ziggurat/​zigbee/​application.py Propagates incoming encryption state.
tests/​test_application.py Tests encryption handling and updated payloads.
tests/​test_api.py Updates API fixtures and assertions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zigpy-review-bot zigpy-review-bot added new feature Adds new feature breaking change Breaking change (mainly for PRs) labels Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking change (mainly for PRs) new feature Adds new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants