Skip to content

Commit ba97340

Browse files
fix: Fix hasAlreadyProcessedMessage when device has multiple endpoints (#8301)
Take into account source endpoint when skipping duplicate transactions.
1 parent 3a1640f commit ba97340

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const transactionStore: {[s: string]: number[]} = {};
138138
export function hasAlreadyProcessedMessage(msg: Fz.Message, model: Definition, ID: number = null, key: string = null) {
139139
if (model.meta && model.meta.publishDuplicateTransaction) return false;
140140
const currentID = ID !== null ? ID : msg.meta.zclTransactionSequenceNumber;
141-
key = key || msg.device.ieeeAddr;
141+
key = key || msg.device.ieeeAddr + '-' + msg.endpoint.ID;
142142
if (transactionStore[key]?.includes(currentID)) return true;
143143
// Keep last 5, as they might come in different order: https://github.com/Koenkk/zigbee2mqtt/issues/20024
144144
transactionStore[key] = [currentID, ...(transactionStore[key] ?? [])].slice(0, 5);

0 commit comments

Comments
 (0)