Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions bellows/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,9 @@ async def send_packet(self, packet: zigpy.types.ZigbeePacket) -> None:
else:
aps_frame.options |= t.EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY

if zigpy.types.TransmitOptions.APS_Encryption in packet.tx_options:
aps_frame.options |= t.EmberApsOption.APS_OPTION_ENCRYPTION

Comment thread
TheJulianJES marked this conversation as resolved.
extended_timeout = packet.extended_timeout

# EmberZNet requires retrying to enable APS ACKs
Expand Down
17 changes: 17 additions & 0 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,23 @@ async def test_send_packet_unicast_force_route_discovery(app, packet):
)


async def test_send_packet_unicast_aps_encryption(app, packet):
await _test_send_packet_unicast(
app,
packet.replace(
tx_options=(
zigpy.types.TransmitOptions.ACK
| zigpy.types.TransmitOptions.APS_Encryption
)
),
options=(
t.EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY
| t.EmberApsOption.APS_OPTION_ENCRYPTION
| t.EmberApsOption.APS_OPTION_RETRY
),
)
Comment thread
TheJulianJES marked this conversation as resolved.


async def test_send_packet_unicast_unexpected_failure(app, packet):
with pytest.raises(zigpy.exceptions.DeliveryError):
await _test_send_packet_unicast(app, packet, status=t.EmberStatus.ERR_FATAL)
Expand Down
Loading