From 1acde903c294436f6a28cedd72151222ed98674e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 13 Aug 2021 19:09:52 +0200 Subject: [PATCH] Add extra logging for quirks. https://github.com/Koenkk/zigbee2mqtt/issues/8331 --- src/controller/model/device.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controller/model/device.ts b/src/controller/model/device.ts index 3d2510a33e..2c545bde4f 100755 --- a/src/controller/model/device.ts +++ b/src/controller/model/device.ts @@ -384,6 +384,8 @@ class Device extends Entity { } private interviewQuirks(): boolean { + debug.log(`Interview - quirks check for '${this.modelID}'-'${this.manufacturerName}'-'${this.type}'`); + // TuYa end devices are typically hard to interview. They also don't require a full interview to work correctly // e.g. no ias enrolling is required for the devices to work. // Assume that in case we got both the manufacturerName and modelID the device works correctly. @@ -394,11 +396,11 @@ class Device extends Entity { // modelID is mostly in the form of e.g. TS0202 and manufacturerName like e.g. _TYZB01_xph99wvr if (this.modelID && this.modelID.match('^TS\\d*$') && this.type === 'EndDevice' && this.manufacturerName && this.manufacturerName.match('^_TYZB01_.*$')) { - debug.log(`Interview procedure failed but got enough for TuYa end device`); this._powerSource = 'Battery'; this._interviewing = false; this._interviewCompleted = true; this.save(); + debug.log(`Interview - quirks matched for TuYa end device`); return true; } @@ -430,8 +432,10 @@ class Device extends Entity { this._interviewing = false; this._interviewCompleted = true; this.save(); + debug.log(`Interview - quirks matched on '${match}'`); return true; } else { + debug.log('Interview - quirks did not match'); return false; } }