From af4184e3ffc38436621af412438d77372ff76ab0 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 17 Dec 2019 19:19:57 +0100 Subject: [PATCH] Always log 'No converter available...` to debug. #2543 --- lib/extension/deviceReceive.js | 4 +--- test/deviceReceive.test.js | 12 +----------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/extension/deviceReceive.js b/lib/extension/deviceReceive.js index 3e0249f05..8127802ea 100755 --- a/lib/extension/deviceReceive.js +++ b/lib/extension/deviceReceive.js @@ -109,9 +109,7 @@ class DeviceReceive extends BaseExtension { // Check if there is an available converter if (!converters.length) { - // Don't log readRsp and raw as warn messages, they are not interesting most of the time. - const level = ['readResponse', 'raw'].includes(data.type) ? 'debug' : 'warn'; - logger[level]( + logger.debug( `No converter available for '${mappedDevice.model}' with cluster '${data.cluster}' ` + `and type '${data.type}' and data '${JSON.stringify(data.data)}'`, ); diff --git a/test/deviceReceive.test.js b/test/deviceReceive.test.js index e80ee3209..e57bde430 100755 --- a/test/deviceReceive.test.js +++ b/test/deviceReceive.test.js @@ -385,17 +385,7 @@ describe('Device receive', () => { await zigbeeHerdsman.events.message(payload); await flushPromises(); expect(MQTT.publish).toHaveBeenCalledTimes(0); - expect(logger.warn).toHaveBeenCalledWith('No converter available for \'ZNCZ02LM\' with cluster \'genBinaryOutput\' and type \'attributeReport\' and data \'{"inactiveText":"hello"}\''); - }); - - it('Should not log when message is from supported device but has no converters is readResponse', async () => { - const device = zigbeeHerdsman.devices.ZNCZ02LM; - const data = {inactiveText: 'hello'}; - const payload = {data, cluster: 'genBinaryOutput', device, endpoint: device.getEndpoint(1), type: 'readResponse', linkquality: 20}; - await zigbeeHerdsman.events.message(payload); - await flushPromises(); - expect(MQTT.publish).toHaveBeenCalledTimes(0); - expect(logger.warn).toBeCalledTimes(0); + expect(logger.debug).toHaveBeenCalledWith('No converter available for \'ZNCZ02LM\' with cluster \'genBinaryOutput\' and type \'attributeReport\' and data \'{"inactiveText":"hello"}\''); }); it('Should allow to calibrate temperature values', async () => {