homebridge-tasmota-control 0.3.49 → 0.3.50-beta.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.
@@ -52,63 +52,6 @@
52
52
  "maximum": 60,
53
53
  "required": true
54
54
  },
55
- "channelsCount": {
56
- "title": "Channels count",
57
- "type": "integer",
58
- "minimum": 1,
59
- "maximum": 8,
60
- "description": "Here select the channels count.",
61
- "oneOf": [{
62
- "title": "1CH",
63
- "enum": [
64
- 1
65
- ]
66
- },
67
- {
68
- "title": "2CH",
69
- "enum": [
70
- 2
71
- ]
72
- },
73
- {
74
- "title": "3CH",
75
- "enum": [
76
- 3
77
- ]
78
- },
79
- {
80
- "title": "4CH",
81
- "enum": [
82
- 4
83
- ]
84
- },
85
- {
86
- "title": "5CH",
87
- "enum": [
88
- 5
89
- ]
90
- },
91
- {
92
- "title": "6CH",
93
- "enum": [
94
- 6
95
- ]
96
- },
97
- {
98
- "title": "7CH",
99
- "enum": [
100
- 7
101
- ]
102
- },
103
- {
104
- "title": "8CH",
105
- "enum": [
106
- 8
107
- ]
108
- }
109
- ],
110
- "required": true
111
- },
112
55
  "enableDebugMode": {
113
56
  "title": "Enable Debug Mode",
114
57
  "type": "boolean",
@@ -157,7 +100,6 @@
157
100
  "expandable": true,
158
101
  "expanded": false,
159
102
  "items": [
160
- "devices[].channelsCount",
161
103
  "devices[].enableDebugMode",
162
104
  "devices[].disableLogInfo",
163
105
  "devices[].refreshInterval"
package/index.js CHANGED
@@ -77,7 +77,6 @@ class tasmotaDevice {
77
77
  this.passwd = config.passwd;
78
78
  this.auth = config.auth;
79
79
  this.refreshInterval = config.refreshInterval || 5;
80
- this.channelsCount = config.channelsCount || 1;
81
80
  this.enableDebugMode = config.enableDebugMode || false;
82
81
  this.disableLogInfo = config.disableLogInfo || false;
83
82
 
@@ -88,6 +87,7 @@ class tasmotaDevice {
88
87
  this.firmwareRevision = 'Firmware Revision';
89
88
 
90
89
  //setup variables
90
+ this.channelsCount = 0;
91
91
  this.checkDeviceInfo = true;
92
92
  this.checkDeviceState = false;
93
93
  this.startPrepareAccessory = true;
@@ -126,10 +126,12 @@ class tasmotaDevice {
126
126
  const modelName = response.data.StatusFWR.Hardware;
127
127
  const addressMac = response.data.StatusNET.Mac;
128
128
  const firmwareRevision = response.data.StatusFWR.Version;
129
+ const channelsCount = response.data.Status.FriendlyName.length;
129
130
 
130
131
  this.log('-------- %s --------', deviceName);
131
132
  this.log('Manufacturer: %s', this.manufacturer);
132
133
  this.log('Hardware: %s', modelName);
134
+ this.log('Channels: %s', channelsCount);
133
135
  this.log('Serialnr: %s', addressMac);
134
136
  this.log('Firmware: %s', firmwareRevision);
135
137
  this.log('----------------------------------');
@@ -137,8 +139,9 @@ class tasmotaDevice {
137
139
  this.modelName = modelName;
138
140
  this.serialNumber = addressMac;
139
141
  this.firmwareRevision = firmwareRevision;
142
+ this.channelsCount = channelsCount;
140
143
 
141
- this.checkDeviceInfo = false;
144
+ this.checkDeviceInfo = (channelsCount == 0);
142
145
  } catch (error) {
143
146
  this.log.error('Device: %s %s, Device Info eror: %s, state: Offline, trying to reconnect', this.host, this.name, error);
144
147
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Tasmota Control",
3
3
  "name": "homebridge-tasmota-control",
4
- "version": "0.3.49",
4
+ "version": "0.3.50-beta.0",
5
5
  "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Tasmota flashed devices.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",