Skip to content

Commit

Permalink
fix: Fix some commands failing due to policy. Koenkk/zigbee2mqtt#18382
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Aug 15, 2023
1 parent e52c466 commit 5bb8501
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controller/model/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ class Endpoint extends Entity {
this.pendingRequests.delete(request);
newRequest.moveCallbacks(request);
}
else if (newRequest.sendPolicy === 'keep-command' || newRequest.sendPolicy === 'keep-cmd-undiv') {
else if ((newRequest.sendPolicy === 'keep-command' || newRequest.sendPolicy === 'keep-cmd-undiv') &&
Array.isArray(request.frame.Payload)) {
const filteredPayload = request.frame.Payload.filter((oldEl: {attrId: number}) =>
!payload.find((newEl: {attrId: number}) => oldEl.attrId === newEl.attrId));
if (filteredPayload.length == 0) {
Expand Down

0 comments on commit 5bb8501

Please sign in to comment.