Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
Lint
  • Loading branch information
asgothian committed Jan 12, 2025
1 parent d161b74 commit 375cdcf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions lib/zigbeecontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class ZigbeeController extends EventEmitter {
getDevice(key) {
try {
return this.herdsman.getDeviceByIeeeAddr(key);
}
}
catch {
return undefined;
}
Expand All @@ -399,7 +399,7 @@ class ZigbeeController extends EventEmitter {
getDevicesByType(type) {
try {
return this.herdsman.getDevicesByType(type);
}
}
catch {
return undefined;
}
Expand All @@ -408,7 +408,7 @@ class ZigbeeController extends EventEmitter {
getDeviceByNetworkAddress(networkAddress) {
try {
return this.herdsman.getDeviceByNetworkAddress(networkAddress);
}
}
catch {
return undefined;
}
Expand Down Expand Up @@ -480,15 +480,15 @@ class ZigbeeController extends EventEmitter {
name: key.type === 'Coordinator' ? 'Coordinator' : key.ieeeAddr,
};
}
}
}
catch {
return undefined;
}

}

async incMsgHandler(message) {
try {
try {
this.debug('incoming msg', message);
const device = await this.herdsman.getDeviceByIeeeAddr(message.srcaddr);
if (!device) {
Expand All @@ -503,7 +503,7 @@ class ZigbeeController extends EventEmitter {
this.event('msg', device.ieeeAddr, message, {
modelId: device.modelId
});
}
}
catch {
return;
}
Expand Down Expand Up @@ -883,7 +883,7 @@ class ZigbeeController extends EventEmitter {
callback && callback(undefined, result);
}
}
catch (error)
catch (error)
{
this.log.error(`error sending ${type} ${cmd} to endpoint: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (95% of all statements in
the enclosing function
have an explicit semicolon).
}
Expand Down
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,10 @@ class Zigbee extends utils.Adapter {
let isGroup = false;
const has_elevated_debug = this.stController.checkDebugDevice(deviceId)

if (has_elevated_debug)
{
let stateNames = [];
stateList.forEach( state => stateNames.push(state.id));
if (has_elevated_debug)
{
const stateNames = [];
stateList.forEach( state => stateNames.push(state.id));
this.log.warn(`ELEVATED O03: Publishing to ${deviceId} of model ${model} ${stateNames.join(', ')}`);
}
else
Expand Down Expand Up @@ -704,15 +704,15 @@ class Zigbee extends utils.Adapter {
if (has_elevated_debug) {
this.log.warn(`ELEVATED OE02.1 Failed to read state '${JSON.stringify(ckey)}'of '${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID}' from query with '${error && error.message ? error.message : 'no error message'}`);
}
else
else
this.log.info(`failed to read state ${JSON.stringify(ckey)} of ${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID} after device query`);
}
}
}
}
if (has_elevated_debug)
this.log.warn(`ELEVATED O07: Device query for '${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID}' complete`);
else
else
this.log.info(`Device query for '${entity.device.ieeeAddr}/${entity.device.endpoints[0].ID}' complete`);

const idToRemove = deviceId;
Expand Down

0 comments on commit 375cdcf

Please sign in to comment.