Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
asgothian committed Oct 20, 2024
1 parent b83b15f commit bcd2c8d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,15 @@ class Zigbee extends utils.Adapter {
const devId = device.ieeeAddr.substr(2);
const meta = {device};

if (this.stController.checkDebugDevice(devId))
this.log.warn(`ELEVATED: Zigbee Event of Type ${type} from device ${safeJsonStringify(device.ieeeAddr)}, incoming event: ${safeJsonStringify(message)}`);
if (this.stController.checkDebugDevice(devId)) {
const shortMessage = {};
for(var propertyName in message) {
if (propertyName == 'object' || propertyName == 'meta') continue;
shortMessage[propertyName] = message[propertyName];
}

this.log.warn(`ELEVATED: Zigbee Event of Type ${type} from device ${safeJsonStringify(device.ieeeAddr)}, incoming event: ${safeJsonStringify(shortMessage)}`);
}
// this assigment give possibility to use iobroker logger in code of the converters, via meta.logger
meta.logger = this.log;

Expand Down

0 comments on commit bcd2c8d

Please sign in to comment.