Always log 'No converter available...` to debug. #2543

This commit is contained in:
Koen Kanters
2019-12-17 19:19:57 +01:00
parent 316755a5c8
commit af4184e3ff
2 changed files with 2 additions and 14 deletions
+1 -3
View File
@@ -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)}'`,
);
+1 -11
View File
@@ -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 () => {