From 97226b01af9ddea52730af4252e7a66f73434a0d Mon Sep 17 00:00:00 2001 From: Viet Dzung Date: Wed, 3 Jul 2019 09:39:47 +0700 Subject: [PATCH] Fix crash with Aqara S2 lock Koenkk/zigbee2mqtt#349 --- src/zcl-packet/lib/foundation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zcl-packet/lib/foundation.ts b/src/zcl-packet/lib/foundation.ts index de76200f2f..ed1cecbf4d 100755 --- a/src/zcl-packet/lib/foundation.ts +++ b/src/zcl-packet/lib/foundation.ts @@ -625,8 +625,9 @@ ru.clause('strPreLenUint8', function (name) { parsedBufLen += 1; this.uint8('len').tap(function () { var attrId = this.vars['attrId']; - // special xiaomi struct-string - if (attrId === 65281) { + var deviceId = zclId.device(260, 10).key; + // special xiaomi struct-string, except xiaomi doorlock because it will crash + if (attrId === 65281&&deviceId!=='doorLock') { ru['xiaoMiStruct'](name)(this); } else { parsedBufLen += this.vars.len;