homebridge-dummy 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/config.schema.json +7 -0
- package/index.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,8 @@ Example config.json:
|
|
|
7
7
|
"accessories": [
|
|
8
8
|
{
|
|
9
9
|
"accessory": "DummySwitch",
|
|
10
|
-
"name": "My Switch 1"
|
|
10
|
+
"name": "My Switch 1",
|
|
11
|
+
"disableLogging": false
|
|
11
12
|
}
|
|
12
13
|
]
|
|
13
14
|
|
|
@@ -17,7 +18,9 @@ With this plugin, you can create any number of fake switches that will do nothin
|
|
|
17
18
|
|
|
18
19
|
For instance, the Philips Hue app will automatically create HomeKit scenes for you based on Hue Scenes you create. But what if you want to create a scene that contains both Philips Hue actions and other actions (like turning on the coffee maker with a WeMo outlet)? You are forced to either modify the Hue-created scene (which can be a HUGE list of actions if you have lots of lights) or build your own HomeKit lighting scenes.
|
|
19
20
|
|
|
20
|
-
Instead, you can link scenes using these dummy switches. Let's say you have a Hue Scene called "Rise and Shine" that you want to activate in the morning. And you have also setup the system HomeKit scene "Good Morning" to turn on your coffee maker and disarm
|
|
21
|
+
Instead, you can link scenes using these dummy switches. Let's say you have a Hue Scene called "Rise and Shine" that you want to activate in the morning. And you have also setup the system HomeKit scene "Good Morning" to turn on your coffee maker and disarm your security system. You can add a single dummy switch to your Good Morning scene, then create a Trigger based on the switching-on of the dummy switch that also activates Rise And Shine.
|
|
22
|
+
|
|
23
|
+
If the disableLogging option is true, state changes (On/Off) will not be logged. The disableLogging option is per switch, so you can choose which ones will get log entries. If not supplied, the default value is false and state changes will be logged.
|
|
21
24
|
|
|
22
25
|
## Stateful Switches
|
|
23
26
|
|
package/config.schema.json
CHANGED
|
@@ -39,7 +39,14 @@
|
|
|
39
39
|
"type": "boolean",
|
|
40
40
|
"default": false,
|
|
41
41
|
"description": "The timer will reset each time the switch is turned on. "
|
|
42
|
+
},
|
|
43
|
+
"disableLogging": {
|
|
44
|
+
"title": "DisableLogging",
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": false,
|
|
47
|
+
"description": "No state change information (On/Off) will be logged. "
|
|
42
48
|
}
|
|
49
|
+
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
52
|
}
|
package/index.js
CHANGED
|
@@ -21,6 +21,7 @@ function DummySwitch(log, config) {
|
|
|
21
21
|
this.resettable = config.resettable;
|
|
22
22
|
this.timer = null;
|
|
23
23
|
this.random = config.random;
|
|
24
|
+
this.disableLogging = config.disableLogging;
|
|
24
25
|
this._service = new Service.Switch(this.name);
|
|
25
26
|
|
|
26
27
|
this.informationService = new Service.AccessoryInformation();
|
|
@@ -66,7 +67,9 @@ DummySwitch.prototype._setOn = function(on, callback) {
|
|
|
66
67
|
msg = msg + " (random delay " + delay + "ms)"
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
this.
|
|
70
|
+
if( ! this.disableLogging ) {
|
|
71
|
+
this.log(msg);
|
|
72
|
+
}
|
|
70
73
|
|
|
71
74
|
if (on && !this.reverse && !this.stateful) {
|
|
72
75
|
if (this.resettable) {
|