node-red-contrib-alice 2.2.1 → 2.2.3

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.
@@ -35,6 +35,7 @@ module.exports = function(RED) {
35
35
  let capab = {
36
36
  type: this.ctype,
37
37
  retrievable: this.retrievable,
38
+ reportable: true,
38
39
  parameters: {
39
40
  instance: this.instance,
40
41
  modes: cfgModes
@@ -5,7 +5,8 @@
5
5
  device: {value:"", type:"alice-device"},
6
6
  name: {value:""},
7
7
  retrievable: {value:true},
8
- response:{value:true}
8
+ response:{value:true},
9
+ split: {value:false}
9
10
  },
10
11
  inputs:1,
11
12
  outputs:1,
@@ -18,8 +19,8 @@
18
19
  if (this.response === undefined){
19
20
  $( "#node-input-response").prop('checked', true);
20
21
  };
21
- if (this.retrievable === undefined){
22
- $( "#node-input-retrievable").prop('checked', true);
22
+ if (this.retrievable === false){
23
+ $( "#node-input-split").prop('checked', true);
23
24
  }
24
25
  },
25
26
  oneditsave: function(){
@@ -36,9 +37,9 @@
36
37
  <input id="node-input-device">
37
38
  </div>
38
39
  <div class="form-row">
39
- <label for="node-input-retrievable"><i class="fa fa-power-off"></i> <span >Main button</span></label>
40
- <label for="node-input-retrievable" style="width:70%">
41
- <input type="checkbox" id="node-input-retrievable" style="display:inline-block; width:22px; vertical-align:baseline;" autocomplete="off"><span>Disable other controls if the device is turned off</span>
40
+ <label for="node-input-split"><i class="fa fa-power-off"></i> <span >Split button</span></label>
41
+ <label for="node-input-split" style="width:70%">
42
+ <input type="checkbox" id="node-input-split" style="display:inline-block; width:22px; vertical-align:baseline;" autocomplete="off"><span>Split On/Off button</span>
42
43
  </label>
43
44
  </div>
44
45
  <div class="form-row">
@@ -9,8 +9,7 @@ function AliceOnOff(config){
9
9
  const ctype = 'devices.capabilities.on_off';
10
10
  const instance = 'on';
11
11
  let response = config.response;
12
- let retrievable = config.retrievable;
13
- let split = false;
12
+ let split = config.split;
14
13
  let initState = false;
15
14
  let curentState = {
16
15
  type:ctype,
@@ -23,10 +22,7 @@ function AliceOnOff(config){
23
22
  if (config.response === undefined){
24
23
  response = true;
25
24
  };
26
- if (config.retrievable === undefined){
27
- retrievable = true;
28
- };
29
- if (!retrievable){
25
+ if (!config.retrievable){
30
26
  split = true;
31
27
  };
32
28
 
@@ -36,7 +32,8 @@ function AliceOnOff(config){
36
32
  this.debug("Starting capability initilization ...");
37
33
  let capab = {
38
34
  type: ctype,
39
- retrievable: retrievable,
35
+ retrievable: true,
36
+ reportable: true,
40
37
  parameters: {
41
38
  instance: instance,
42
39
  split: split
@@ -30,6 +30,7 @@ module.exports = function(RED) {
30
30
  let capab = {
31
31
  type: this.ctype,
32
32
  retrievable: this.retrievable,
33
+ reportable: true,
33
34
  parameters: {
34
35
  instance: this.instance,
35
36
  unit: this.unit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-alice",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "",
5
5
  "main": "alice.js",
6
6
  "scripts": {
@@ -43,6 +43,6 @@
43
43
  "homepage": "https://github.com/efa2000/node-red-contrib-alice#readme",
44
44
  "dependencies": {
45
45
  "axios": "^1.4.0",
46
- "mqtt": "^4.3.7"
46
+ "mqtt": "^4.3.8"
47
47
  }
48
48
  }