Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Sep 9, 2019
1 parent d0242fb commit eb69ea6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/extension/networkMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class NetworkMap {
onMQTTMessage(topic, message) {
message = message.toString();
const includeRoutes = (topic === this.topicRoutes) ? 1: 0;
if ((topic === this.topic || topic === this.topicRoutes)
&& this.supportedFormats.hasOwnProperty(message)) {
if ((topic === this.topic || topic === this.topicRoutes) &&
this.supportedFormats.hasOwnProperty(message)) {
this.zigbee.networkScan(includeRoutes, (result)=> {
const converted = this.supportedFormats[message](this.zigbee, result);
this.mqtt.publish(`bridge/networkmap/${message}`, converted, {});
Expand Down Expand Up @@ -110,8 +110,8 @@ class NetworkMap {
devStyle = `style="rounded, filled", fillcolor="${colors.fill.router}", ` +
`fontcolor="${colors.font.router}"`;
} else {
devStyle = `style="rounded, dashed, filled", fillcolor="${colors.fill.enddevice}", `
+ `fontcolor="${colors.font.enddevice}"`;
devStyle = `style="rounded, dashed, filled", fillcolor="${colors.fill.enddevice}", ` +
`fontcolor="${colors.font.enddevice}"`;
}

// Add the device with its labels to the graph as a node.
Expand All @@ -124,13 +124,13 @@ class NetworkMap {
*/
topology.links.filter((e) => (e.sourceIeeeAddr === device.ieeeAddr) || (e.SourceNwkAddr === device.nwkAddr))
.forEach((e) => {
const lineStyle = (device.type=='EndDevice') ? 'penwidth=1, '
: (!e.routes.length) ? 'penwidth=0.5, ' : 'penwidth=2, ';
const lineWeight = (!e.routes.length) ? `weight=0, color="${colors.line.inactive}", `
: `weight=1, color="${colors.line.active}", `;
const lineStyle = (device.type=='EndDevice') ? 'penwidth=1, ' : (!e.routes.length) ?
'penwidth=0.5, ' : 'penwidth=2, ';
const lineWeight = (!e.routes.length) ? `weight=0, color="${colors.line.inactive}", ` :
`weight=1, color="${colors.line.active}", `;
const textRoutes = e.routes.map((r) => `0x${r.toString(16)}`);
const lineLabels = (!e.routes.length) ? `label="${e.lqi}"`
: `label="${e.lqi}\\n[${textRoutes.join(']\\n[')}]"`;
const lineLabels = (!e.routes.length) ? `label="${e.lqi}"` :
`label="${e.lqi}\\n[${textRoutes.join(']\\n[')}]"`;
text += ` "${device.ieeeAddr}" -> "${e.targetIeeeAddr}"`;
text += ` [${lineStyle}${lineWeight}${lineLabels}]\n`;
});
Expand Down

0 comments on commit eb69ea6

Please sign in to comment.