homebridge-cmd4 6.3.0 → 7.0.0-beta2
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/CHANGELOG.md +41 -32
- package/Cmd4Accessory.js +19 -86
- package/Cmd4Platform.js +0 -55
- package/Cmd4PriorityPollingQueue.js +246 -90
- package/Cmd4PriorityPollingQueue.js.1 +1148 -0
- package/Extras/config.json +110 -110
- package/Extras/config.min.json +111 -111
- package/RUNNING_CHANGELOG.md +48 -0
- package/cmd4Constants.js +56 -2
- package/docs/Developers.md +21 -23
- package/package.json +1 -1
package/RUNNING_CHANGELOG.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Homebridge UI User. Do not click on any inline links. Homebridge UI does not supprt them. Bug#1098
|
|
4
4
|
|
|
5
5
|
## ChangeLog
|
|
6
|
+
* <a href="#Whats-new-in-6-3-1">**Whats new in 7.0.0**</a>
|
|
6
7
|
* <a href="#Whats-new-in-6-3-0">**Whats new in 6.3.0**</a>
|
|
7
8
|
* <a href="#Whats-new-in-6-2-0">**Whats new in 6.2.0**</a>
|
|
8
9
|
* <a href="#Whats-new-in-6-1-2">**Whats new in 6.1.2**</a>
|
|
@@ -84,6 +85,53 @@
|
|
|
84
85
|
* <a href="#Whats-new-in-2-1">**Whats new in 2.1**</a>
|
|
85
86
|
* <a href="#Whats-new-in-2-0">**Whats new in 2.0**</a>
|
|
86
87
|
|
|
88
|
+
<a name="Whats-new-in-6-3-1">## Whats new in 6.3.1</a>
|
|
89
|
+
#### 7.0.0 (2023-03-05)
|
|
90
|
+
|
|
91
|
+
* The reason for the major version numbering update was to for deprecation warnings to throw an error.
|
|
92
|
+
These warnings were there for many major versions and are finally removed.
|
|
93
|
+
|
|
94
|
+
"queueInterval" - Never put into production and will now throw an error.
|
|
95
|
+
"queueMsg" - Never put into production and will now throw an error.
|
|
96
|
+
"queueStatMsgInterval" - Never put into production and will now throw an error.
|
|
97
|
+
"cmd4_Mode" - Obsolete for many versions and will now throw an error.
|
|
98
|
+
"storage" - Obsolete outside of fakegato definition.
|
|
99
|
+
"storagePath" - Obsolete outside of fakegato definition.
|
|
100
|
+
"folder" - Obsolete outside of fakegato definition.
|
|
101
|
+
"keyPath" - Obsolete outside of fakegato definition.
|
|
102
|
+
"queueTypes" - Obsolete inside accessory definition.
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
##### New Features
|
|
106
|
+
|
|
107
|
+
* add retries. Also formatting issues ([b8ddf9ce](https://github.com/ztalbot2000/homebridge-cmd4/commit/b8ddf9ceda8ace3a6e820bfad0c4a03c656cf419))
|
|
108
|
+
|
|
109
|
+
##### Documentation Changes
|
|
110
|
+
|
|
111
|
+
Beta2
|
|
112
|
+
* Update documentation for v7.0.0 ([12b6482a](https://github.com/ztalbot2000/homebridge-cmd4/commit/12b6482ac8e6d431e011f6f92c2d6f03a2ebe2ed))
|
|
113
|
+
|
|
114
|
+
##### Bug Fixes
|
|
115
|
+
|
|
116
|
+
Beta2
|
|
117
|
+
* remove unwanted debug message and test so that it cannot reoccur ([97b6b318](https://github.com/ztalbot2000/homebridge-cmd4/commit/97b6b31861ab34d04b798ec409b1f2e8c56244c2))
|
|
118
|
+
* Homebridge does not like underscores of accessory names. Remove from default config.json ([15f2170b](https://github.com/ztalbot2000/homebridge-cmd4/commit/15f2170be492b6dfb56e4eed5d76da0cd4d74419))
|
|
119
|
+
|
|
120
|
+
Beta1
|
|
121
|
+
* retry logging starts from zero, but for user count starts from 1 ([38cdf417](https://github.com/ztalbot2000/homebridge-cmd4/commit/38cdf417feebeef2b75dcfec247e6bdfd4739604))
|
|
122
|
+
* By nature retryCount should start from zero ([b8e82ffe](https://github.com/ztalbot2000/homebridge-cmd4/commit/b8e82ffe262c092a301636993544be828a7a34a4))
|
|
123
|
+
* log message in wrong quotes ([6fc555b0](https://github.com/ztalbot2000/homebridge-cmd4/commit/6fc555b0d7bdc20bfc3a38310e3d4f66b968d55d))
|
|
124
|
+
* retries for WoRm should be zero. Can be overriden ([11351633](https://github.com/ztalbot2000/homebridge-cmd4/commit/1135163319c8d16e3886dbf0a0443ba5ed6c4b99))
|
|
125
|
+
* Accessory needs to go unresponsive via updateValue with error object ([cdfee1b2](https://github.com/ztalbot2000/homebridge-cmd4/commit/cdfee1b22ea21dc56edc320768ec6ebea1156cb8))
|
|
126
|
+
|
|
127
|
+
##### Tests
|
|
128
|
+
|
|
129
|
+
* put back skipped tests ([0b0781fa](https://github.com/ztalbot2000/homebridge-cmd4/commit/0b0781faec7f94e43d67068e15e9505cc7c96414))
|
|
130
|
+
* Remove excess debug messages for commit with verify to work ([ea108470](https://github.com/ztalbot2000/homebridge-cmd4/commit/ea108470631f4abe3377f6d582c962dab141be0f))
|
|
131
|
+
* Don't know why HomeKit does not cause Cmd4 to generate a log that it is trying to reconnect after unavailable ([d45d7c09](https://github.com/ztalbot2000/homebridge-cmd4/commit/d45d7c095d0989c05b88c161a418402711e26677))
|
|
132
|
+
* Add unit testing to prove fix of bug[#130](https://github.com/ztalbot2000/homebridge-cmd4/pull/130) ([e9a902fc](https://github.com/ztalbot2000/homebridge-cmd4/commit/e9a902fcb01fb2ee7c7cb9f2b60e036d0fd5c0d6))
|
|
133
|
+
|
|
134
|
+
|
|
87
135
|
<a name="Whats-new-in-6-3-0">## Whats new in 6.3.0</a>
|
|
88
136
|
### 6.3.0 (2022-04-12)
|
|
89
137
|
|
package/cmd4Constants.js
CHANGED
|
@@ -86,6 +86,10 @@ var cmd4Constants = {
|
|
|
86
86
|
QUEUETYPE_STANDARD: "StandarD",
|
|
87
87
|
// Used internally to mean entries go straight through the queue
|
|
88
88
|
QUEUETYPE_PASSTHRU: "None",
|
|
89
|
+
DEFAULT_STANDARD_QUEUE_RETRY_COUNT: 0,
|
|
90
|
+
DEFAULT_WORM_QUEUE_RETRY_COUNT: 0,
|
|
91
|
+
QUEUE_RETRIES: "retries",
|
|
92
|
+
|
|
89
93
|
|
|
90
94
|
|
|
91
95
|
// Platform/Accessory Config Constants
|
|
@@ -137,18 +141,68 @@ var cmd4Constants = {
|
|
|
137
141
|
VALUE_lv: "value",
|
|
138
142
|
CMD4_STORAGE_lv: "cmd4Storage",
|
|
139
143
|
|
|
144
|
+
ERROR_STRING_MIN: -151,
|
|
140
145
|
ERROR_TIMER_EXPIRED: -151,
|
|
141
|
-
//
|
|
146
|
+
// ERROR_CMD_FAILED_REPLY: -152,
|
|
142
147
|
ERROR_NULL_REPLY: -153,
|
|
143
148
|
ERROR_NULL_STRING_REPLY: -154,
|
|
144
149
|
ERROR_EMPTY_STRING_REPLY: -155,
|
|
145
150
|
ERROR_2ND_NULL_STRING_REPLY: -156,
|
|
146
151
|
ERROR_NON_CONVERTABLE_REPLY: -157,
|
|
147
152
|
ERROR_NO_DATA_REPLY: -158,
|
|
153
|
+
ERROR_STRING_MAX: -158,
|
|
154
|
+
ERROR_STRINGS:
|
|
155
|
+
[ // cmd4Constants.ERROR_TIMER_EXPIRED -151
|
|
156
|
+
"Timer expired contacting accessory",
|
|
157
|
+
// cmd4Constants.ERROR_CMD_FAILED_REPLY -152
|
|
158
|
+
"Command failed",
|
|
159
|
+
// cmd4Constants.ERROR_NULL_REPLY -153
|
|
160
|
+
"Reply is NULL",
|
|
161
|
+
// cmd4Constants.ERROR_NULL_STRING_REPLY -154
|
|
162
|
+
"Reply is NULL string",
|
|
163
|
+
// cmd4Constants.ERROR_EMPTY_STRING_REPLY -155
|
|
164
|
+
"Reply is an empty string",
|
|
165
|
+
// cmd4Constants.ERROR_2ND_NULL_STRING_REPLY -156
|
|
166
|
+
"Reply is still NULL",
|
|
167
|
+
// cmd4Constants.ERROR_NON_CONVERTABLE_REPLY -157
|
|
168
|
+
"Cannot convert characteristic string",
|
|
169
|
+
// cmd4Constants.ERROR_NO_DATA_REPLY -158
|
|
170
|
+
"No data returned from accessory"
|
|
171
|
+
],
|
|
172
|
+
|
|
173
|
+
// Convert our known Error Codes to strings
|
|
174
|
+
errorString: function( index )
|
|
175
|
+
{
|
|
176
|
+
let offset = - index + cmd4Constants.ERROR_STRING_MIN ;
|
|
177
|
+
let max = cmd4Constants.ERROR_STRING_MIN - cmd4Constants.ERROR_STRING_MAX;
|
|
178
|
+
|
|
179
|
+
//console.log(" index is " + index );
|
|
180
|
+
//console.log(" offset is " + offset );
|
|
181
|
+
//console.log(" max is " + max );
|
|
182
|
+
// i.e 0-7
|
|
183
|
+
if ( index == 0 )
|
|
184
|
+
return "Device returned SUCCESS; " + index;
|
|
185
|
+
|
|
186
|
+
//if ( offset < 0 || offset > max )
|
|
187
|
+
if ( index > cmd4Constants.ERROR_STRING_MIN )
|
|
188
|
+
return "Device returned its own error; " + index;
|
|
189
|
+
if ( index < cmd4Constants.ERROR_STRING_MAX )
|
|
190
|
+
return "Device returned its own error; " + index;
|
|
191
|
+
|
|
192
|
+
// Should not happen because of the above checks
|
|
193
|
+
if ( offset < 0 )
|
|
194
|
+
return "Invalid Error min index: " + index;
|
|
195
|
+
|
|
196
|
+
// Should not happen because of the above checks
|
|
197
|
+
if ( offset > max )
|
|
198
|
+
return "Invalid Error max index: " + index;
|
|
199
|
+
|
|
200
|
+
return cmd4Constants.ERROR_STRINGS[ offset ];
|
|
201
|
+
},
|
|
148
202
|
|
|
149
203
|
|
|
150
204
|
|
|
151
205
|
// Static Messages
|
|
152
|
-
DBUSY: "Perhaps your device is busy?"
|
|
206
|
+
DBUSY: "Perhaps your device is busy or unavailable?"
|
|
153
207
|
};
|
|
154
208
|
module.exports = cmd4Constants;
|
package/docs/Developers.md
CHANGED
|
@@ -201,30 +201,25 @@ Notice that there is no Platform definition. Otherwise everything is the same. Y
|
|
|
201
201
|
|
|
202
202
|
Typically polling is pretty much a free for all. While Cmd4 tries to eleviate this with staggered polling, Cmd4 supports two kinds of Priority Queued Polling; that being "Sequential" and "WoRm" ( Write Once Read Many). If configured correctly, only one Set characteristic value can be sent or either one or multiple Gets from a device at a time. The priority given to requests from IOS first and background polling second.<BR>
|
|
203
203
|
<BR>
|
|
204
|
-
Priority Queued Polling is only available when a queue is defined. The default "QueueType" being "WoRm". To configure Priority Queued Polling every characteristic to the device must be configured to be in the same queue
|
|
204
|
+
Priority Queued Polling is only available when a queue is defined. The default "QueueType" being "WoRm". To configure Priority Queued Polling every characteristic to the device must be configured to be in the same queue.<BR>
|
|
205
|
+
The retries defaults to zero for "Get" commands from homebridge. You can alter this value as you like.<BR>
|
|
206
|
+
For Example of the default WoRm is:
|
|
205
207
|
|
|
206
208
|
```json
|
|
207
|
-
"
|
|
208
|
-
"
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
"queueTypes": [ { "queue": "A", "queueType": "WoRm", "retries": 0 } ],
|
|
210
|
+
"accessories": [
|
|
211
|
+
{
|
|
212
|
+
"interval": 5,
|
|
213
|
+
"queue: "A",
|
|
214
|
+
"polling": [ { "characteristic": "currentTemperature" },
|
|
215
|
+
{ "characteristic": "targetTemperature", "interval": 15 }
|
|
216
|
+
]
|
|
217
|
+
}
|
|
211
218
|
```
|
|
212
219
|
The interval of the characteristic is defined through the heirarch of the Platform/Accessory and then the Characteristic, as always.<BR>
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```json
|
|
216
|
-
"queueTypes: [ { "queue": "A" : "queueType": "WoRm" }
|
|
217
|
-
],
|
|
218
|
-
"queue": "A",
|
|
219
|
-
"interval": 10,
|
|
220
|
-
"polling": [ { "characteristic": "currentTemperature" },
|
|
221
|
-
{ "characteristic": "targetTemperature", "interval": 15 }
|
|
222
|
-
]
|
|
223
|
-
```
|
|
224
|
-
Example 3:
|
|
220
|
+
Example 2:
|
|
225
221
|
|
|
226
222
|
```json
|
|
227
|
-
"queueTypes: [ { "queue": "A" : "queueType": "WoRm" }
|
|
228
223
|
"platforms":
|
|
229
224
|
[ { "platform": "Cmd4",
|
|
230
225
|
"interval": "10",
|
|
@@ -232,7 +227,6 @@ Example 3:
|
|
|
232
227
|
{ "queue": "B" : "queueType": "Sequential" }
|
|
233
228
|
{ "queue": "C" } // Defaults to "WoRm"
|
|
234
229
|
],
|
|
235
|
-
|
|
236
230
|
"accessories": [
|
|
237
231
|
{
|
|
238
232
|
"name": "My_Thermostat",
|
|
@@ -262,7 +256,8 @@ Example 3:
|
|
|
262
256
|
{
|
|
263
257
|
"name": "Switch2",
|
|
264
258
|
"type": "Switch",
|
|
265
|
-
"
|
|
259
|
+
"queue": "D", // Defaults to WoRm
|
|
260
|
+
"polling": [ { "characteristic": "on" } ],
|
|
266
261
|
...
|
|
267
262
|
}
|
|
268
263
|
|
|
@@ -292,8 +287,9 @@ Example 3:
|
|
|
292
287
|
"manufacturer": "Advantage Air Australia",
|
|
293
288
|
"model": "e-zone",
|
|
294
289
|
"serialNumber": "Fujitsu e-zone2",
|
|
290
|
+
"queue": "A",
|
|
295
291
|
"polling": [
|
|
296
|
-
{ "characteristic": "currentTemperature"
|
|
292
|
+
{ "characteristic": "currentTemperature" }
|
|
297
293
|
],
|
|
298
294
|
"props": {
|
|
299
295
|
"currentTemperature": {
|
|
@@ -313,8 +309,9 @@ Example 3:
|
|
|
313
309
|
"manufacturer": "Advantage Air Australia",
|
|
314
310
|
"model": "e-zone",
|
|
315
311
|
"serialNumber": "Fujitsu e-zone2",
|
|
312
|
+
"queue": "A",
|
|
316
313
|
"polling": [
|
|
317
|
-
{ "characteristic": "On"
|
|
314
|
+
{ "characteristic": "On" }
|
|
318
315
|
],
|
|
319
316
|
"state_cmd": "bash /home/pi/zones.sh",
|
|
320
317
|
"state_cmd_suffix": "z05"
|
|
@@ -327,8 +324,9 @@ Example 3:
|
|
|
327
324
|
"manufacturer": "Advantage Air Australia",
|
|
328
325
|
"model": "e-zone",
|
|
329
326
|
"serialNumber": "Fujitsu e-zone2",
|
|
327
|
+
"queue": "A",
|
|
330
328
|
"polling": [
|
|
331
|
-
{ "characteristic": "on"
|
|
329
|
+
{ "characteristic": "on" }
|
|
332
330
|
],
|
|
333
331
|
"stateChangeResponseTime": 1,
|
|
334
332
|
"state_cmd": "bash /home/pi/ezone.sh"
|