From 923120c4bcf5c60a6f75f25017730fa35ffb879b Mon Sep 17 00:00:00 2001 From: Jorge Rivera Date: Fri, 18 Nov 2022 11:52:21 +0100 Subject: [PATCH] Fix typo replacing tabs for spaces --- index.js | 44 ++++++++++++++++++++++---------------------- module.json | 12 ++++++------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/index.js b/index.js index 7c0499a..1c558de 100644 --- a/index.js +++ b/index.js @@ -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; @@ -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"); @@ -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); }; diff --git a/module.json b/module.json index 15e1c1d..484f5ef 100644 --- a/module.json +++ b/module.json @@ -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", @@ -43,10 +43,10 @@ }, "options": { "fields": { - "deviceType": { + "deviceType": { "label": "__m_type__", - "type": "select" - }, + "type": "select" + }, "toggleDeviceOn": { "fieldClass": "toggleDeviceOn", "label": "__m_toggle_on__",