@@ -46,24 +46,24 @@ VirtualSwitch.prototype.init = function (config) {
46
46
//level = "off";
47
47
}
48
48
49
- var defaults = {
50
- metrics : {
51
- title : self . getInstanceTitle ( ) ,
52
- icon : icon ,
49
+ var defaults = {
50
+ metrics : {
51
+ title : self . getInstanceTitle ( ) ,
52
+ icon : icon ,
53
53
level : level
54
- }
55
- } ;
54
+ }
55
+ } ;
56
56
57
- var overlay = {
58
- deviceType : deviceType ,
59
- probeType : probeType
60
- } ;
57
+ var overlay = {
58
+ deviceType : deviceType ,
59
+ probeType : probeType
60
+ } ;
61
61
62
- this . vDev = this . controller . devices . create ( {
63
- deviceId : this . getName ( ) + "_" + this . id ,
64
- defaults : defaults ,
65
- overlay : overlay ,
66
- handler : function ( command , args ) {
62
+ this . vDev = this . controller . devices . create ( {
63
+ deviceId : this . getName ( ) + "_" + this . id ,
64
+ defaults : defaults ,
65
+ overlay : overlay ,
66
+ handler : function ( command , args ) {
67
67
68
68
// Get device type to support on/open and off/close
69
69
var vDevType = deviceType ;
@@ -73,7 +73,7 @@ VirtualSwitch.prototype.init = function (config) {
73
73
74
74
if ( command === 'update' ) {
75
75
// Do nothing
76
- }
76
+ }
77
77
else if ( ( command === "on" ) || ( command === "open" ) ) {
78
78
console . log ( "Virtual Switch: '" + deviceName + "' command: 'on/open' " ) ;
79
79
self . controller . devices . get ( self . config . toggleDeviceOn ) . performCommand ( "on" ) ;
@@ -98,15 +98,15 @@ VirtualSwitch.prototype.init = function (config) {
98
98
}
99
99
} ,
100
100
101
- moduleId : this . id
102
- } ) ;
101
+ moduleId : this . id
102
+ } ) ;
103
103
} ;
104
104
105
105
VirtualSwitch . prototype . stop = function ( ) {
106
- if ( this . vDev ) {
107
- this . controller . devices . remove ( this . vDev . id ) ;
108
- this . vDev = null ;
109
- }
106
+ if ( this . vDev ) {
107
+ this . controller . devices . remove ( this . vDev . id ) ;
108
+ this . vDev = null ;
109
+ }
110
110
111
111
VirtualSwitch . super_ . prototype . stop . call ( this ) ;
112
112
} ;
0 commit comments