Log uninteresting messages without converters as debug.

This commit is contained in:
Koen Kanters
2019-10-26 18:03:44 +02:00
parent 6f92a41ca9
commit 63ffe279ea
+7 -8
View File
@@ -86,14 +86,13 @@ class DeviceReceive extends BaseExtension {
// Check if there is an available converter
if (!converters.length) {
// Don't log readRsp messages, they are not interesting most of the time.
if (data.type !== 'readResponse') {
logger.warn(
`No converter available for '${mappedDevice.model}' with cluster '${data.cluster}' ` +
`and type '${data.type}' and data '${JSON.stringify(data.data)}'`
);
logger.warn(`Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html.`);
}
// 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](
`No converter available for '${mappedDevice.model}' with cluster '${data.cluster}' ` +
`and type '${data.type}' and data '${JSON.stringify(data.data)}'`
);
logger[level](`Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html.`);
return;
}