Skip to content

Commit

Permalink
Fix typo replacing tabs for spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
latchdevel committed Nov 18, 2022
1 parent ec68246 commit 923120c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
44 changes: 22 additions & 22 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ VirtualSwitch.prototype.init = function (config) {
//level = "off";
}

var defaults = {
metrics: {
title: self.getInstanceTitle(),
icon: icon,
var defaults = {
metrics: {
title: self.getInstanceTitle(),
icon: icon,
level: level
}
};
}
};

var overlay = {
deviceType: deviceType,
probeType: probeType
};
var overlay = {
deviceType: deviceType,
probeType: probeType
};

this.vDev = this.controller.devices.create({
deviceId: this.getName() + "_" + this.id,
defaults: defaults,
overlay: overlay,
handler: function(command, args) {
this.vDev = this.controller.devices.create({
deviceId: this.getName() + "_" + this.id,
defaults: defaults,
overlay: overlay,
handler: function(command, args) {

// Get device type to support on/open and off/close
var vDevType = deviceType;
Expand All @@ -73,7 +73,7 @@ VirtualSwitch.prototype.init = function (config) {

if (command === 'update') {
// Do nothing
}
}
else if ((command === "on") || (command === "open")) {
console.log("Virtual Switch: '" + deviceName + "' command: 'on/open' ");
self.controller.devices.get(self.config.toggleDeviceOn).performCommand("on");
Expand All @@ -98,15 +98,15 @@ VirtualSwitch.prototype.init = function (config) {
}
},

moduleId: this.id
});
moduleId: this.id
});
};

VirtualSwitch.prototype.stop = function () {
if (this.vDev) {
this.controller.devices.remove(this.vDev.id);
this.vDev = null;
}
if (this.vDev) {
this.controller.devices.remove(this.vDev.id);
this.vDev = null;
}

VirtualSwitch.super_.prototype.stop.call(this);
};
Expand Down
12 changes: 6 additions & 6 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"type": "object",
"properties": {
"deviceType" : {
"type": "string",
"enum": ["Binary Switch", "Door Lock"],
"required": true
"type": "string",
"enum": ["Binary Switch", "Door Lock"],
"required": true
},
"toggleDeviceOn": {
"field": "enum",
Expand All @@ -43,10 +43,10 @@
},
"options": {
"fields": {
"deviceType": {
"deviceType": {
"label": "__m_type__",
"type": "select"
},
"type": "select"
},
"toggleDeviceOn": {
"fieldClass": "toggleDeviceOn",
"label": "__m_toggle_on__",
Expand Down

0 comments on commit 923120c

Please sign in to comment.