bt-sensors-plugin-sk 1.1.0-beta.2.2.1.5 → 1.1.0-beta.2.2.2
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 +7 -1
- package/package.json +3 -2
- package/sensor_classes/BTHome/AbstractBTHomeSensor.js +199 -0
- package/sensor_classes/BTHome/BTHomeServiceData.js +2289 -0
- package/sensor_classes/LancolVoltageMeter.js +39 -0
- package/sensor_classes/ShellySBHT003C.js +109 -0
- package/sensor_classes/VictronBatteryMonitor.js +3 -3
|
@@ -0,0 +1,2289 @@
|
|
|
1
|
+
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
|
2
|
+
|
|
3
|
+
(function (root, factory) {
|
|
4
|
+
if (typeof define === 'function' && define.amd) {
|
|
5
|
+
define(['kaitai-struct/KaitaiStream'], factory);
|
|
6
|
+
} else if (typeof module === 'object' && module.exports) {
|
|
7
|
+
module.exports = factory(require('kaitai-struct/KaitaiStream'));
|
|
8
|
+
} else {
|
|
9
|
+
root.BthomeServiceData = factory(root.KaitaiStream);
|
|
10
|
+
}
|
|
11
|
+
}(typeof self !== 'undefined' ? self : this, function (KaitaiStream) {
|
|
12
|
+
/**
|
|
13
|
+
* BLE advertising in the BTHome v2 format
|
|
14
|
+
* @see {@link https://bthome.io/format/|Source}
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var BthomeServiceData = (function() {
|
|
18
|
+
BthomeServiceData.BthomeObjectId = Object.freeze({
|
|
19
|
+
MISC_PACKET_ID: 0,
|
|
20
|
+
SENSOR_BATTERY: 1,
|
|
21
|
+
SENSOR_TEMPERATURE_0_01: 2,
|
|
22
|
+
SENSOR_HUMIDITY_0_01: 3,
|
|
23
|
+
SENSOR_PRESSURE_0_01: 4,
|
|
24
|
+
SENSOR_ILLUMINANCE_0_01: 5,
|
|
25
|
+
SENSOR_MASS_KG_0_01: 6,
|
|
26
|
+
SENSOR_MASS_LB_0_01: 7,
|
|
27
|
+
SENSOR_DEWPOINT_0_01: 8,
|
|
28
|
+
SENSOR_COUNT: 9,
|
|
29
|
+
SENSOR_ENERGY_0_001: 10,
|
|
30
|
+
SENSOR_POWER_0_01: 11,
|
|
31
|
+
SENSOR_VOLTAGE_0_001: 12,
|
|
32
|
+
SENSOR_PM2_5: 13,
|
|
33
|
+
SENSOR_PM10: 14,
|
|
34
|
+
BINARY_GENERIC_BOOLEAN: 15,
|
|
35
|
+
BINARY_POWER: 16,
|
|
36
|
+
BINARY_OPENING: 17,
|
|
37
|
+
SENSOR_CO2: 18,
|
|
38
|
+
SENSOR_TVOC: 19,
|
|
39
|
+
SENSOR_MOISTURE_0_01: 20,
|
|
40
|
+
BINARY_BATTERY: 21,
|
|
41
|
+
BINARY_BATTERY_CHARGING: 22,
|
|
42
|
+
BINARY_CARBON_MONOXIDE: 23,
|
|
43
|
+
BINARY_COLD: 24,
|
|
44
|
+
BINARY_CONNECTIVITY: 25,
|
|
45
|
+
BINARY_DOOR: 26,
|
|
46
|
+
BINARY_GARAGE_DOOR: 27,
|
|
47
|
+
BINARY_GAS: 28,
|
|
48
|
+
BINARY_HEAT: 29,
|
|
49
|
+
BINARY_LIGHT: 30,
|
|
50
|
+
BINARY_LOCK: 31,
|
|
51
|
+
BINARY_MOISTURE: 32,
|
|
52
|
+
BINARY_MOTION: 33,
|
|
53
|
+
BINARY_MOVING: 34,
|
|
54
|
+
BINARY_OCCUPANCY: 35,
|
|
55
|
+
BINARY_PLUG: 36,
|
|
56
|
+
BINARY_PRESENCE: 37,
|
|
57
|
+
BINARY_PROBLEM: 38,
|
|
58
|
+
BINARY_RUNNING: 39,
|
|
59
|
+
BINARY_SAFETY: 40,
|
|
60
|
+
BINARY_SMOKE: 41,
|
|
61
|
+
BINARY_SOUND: 42,
|
|
62
|
+
BINARY_TAMPER: 43,
|
|
63
|
+
BINARY_VIBRATION: 44,
|
|
64
|
+
BINARY_WINDOW: 45,
|
|
65
|
+
SENSOR_HUMIDITY: 46,
|
|
66
|
+
SENSOR_MOISTURE: 47,
|
|
67
|
+
EVENT_BUTTON: 58,
|
|
68
|
+
EVENT_DIMMER: 60,
|
|
69
|
+
SENSOR_COUNT_UINT16: 61,
|
|
70
|
+
SENSOR_COUNT_UINT32: 62,
|
|
71
|
+
SENSOR_ROTATION_0_1: 63,
|
|
72
|
+
SENSOR_DISTANCE_MM: 64,
|
|
73
|
+
SENSOR_DISTANCE_M_0_1: 65,
|
|
74
|
+
SENSOR_DURATION_0_001: 66,
|
|
75
|
+
SENSOR_CURRENT_0_001: 67,
|
|
76
|
+
SENSOR_SPEED_0_01: 68,
|
|
77
|
+
SENSOR_TEMPERATURE_0_1: 69,
|
|
78
|
+
SENSOR_UV_INDEX_0_1: 70,
|
|
79
|
+
SENSOR_VOLUME_0_1: 71,
|
|
80
|
+
SENSOR_VOLUME: 72,
|
|
81
|
+
SENSOR_VOLUME_FLOW_RATE_0_001: 73,
|
|
82
|
+
SENSOR_VOLTAGE_0_1: 74,
|
|
83
|
+
SENSOR_GAS: 75,
|
|
84
|
+
SENSOR_GAS_UINT32: 76,
|
|
85
|
+
SENSOR_ENERGY_0_001_UINT32: 77,
|
|
86
|
+
SENSOR_VOLUME_0_001: 78,
|
|
87
|
+
SENSOR_WATER: 79,
|
|
88
|
+
SENSOR_TIMESTAMP: 80,
|
|
89
|
+
SENSOR_ACCELERATION: 81,
|
|
90
|
+
SENSOR_GYROSCOPE: 82,
|
|
91
|
+
SENSOR_TEXT: 83,
|
|
92
|
+
SENSOR_RAW: 84,
|
|
93
|
+
SENSOR_VOLUME_STORAGE: 85,
|
|
94
|
+
DEVICE_TYPE: 240,
|
|
95
|
+
DEVICE_FW_VERSION_UINT32: 241,
|
|
96
|
+
DEVICE_FW_VERSION_UINT24: 242,
|
|
97
|
+
|
|
98
|
+
0: "MISC_PACKET_ID",
|
|
99
|
+
1: "SENSOR_BATTERY",
|
|
100
|
+
2: "SENSOR_TEMPERATURE_0_01",
|
|
101
|
+
3: "SENSOR_HUMIDITY_0_01",
|
|
102
|
+
4: "SENSOR_PRESSURE_0_01",
|
|
103
|
+
5: "SENSOR_ILLUMINANCE_0_01",
|
|
104
|
+
6: "SENSOR_MASS_KG_0_01",
|
|
105
|
+
7: "SENSOR_MASS_LB_0_01",
|
|
106
|
+
8: "SENSOR_DEWPOINT_0_01",
|
|
107
|
+
9: "SENSOR_COUNT",
|
|
108
|
+
10: "SENSOR_ENERGY_0_001",
|
|
109
|
+
11: "SENSOR_POWER_0_01",
|
|
110
|
+
12: "SENSOR_VOLTAGE_0_001",
|
|
111
|
+
13: "SENSOR_PM2_5",
|
|
112
|
+
14: "SENSOR_PM10",
|
|
113
|
+
15: "BINARY_GENERIC_BOOLEAN",
|
|
114
|
+
16: "BINARY_POWER",
|
|
115
|
+
17: "BINARY_OPENING",
|
|
116
|
+
18: "SENSOR_CO2",
|
|
117
|
+
19: "SENSOR_TVOC",
|
|
118
|
+
20: "SENSOR_MOISTURE_0_01",
|
|
119
|
+
21: "BINARY_BATTERY",
|
|
120
|
+
22: "BINARY_BATTERY_CHARGING",
|
|
121
|
+
23: "BINARY_CARBON_MONOXIDE",
|
|
122
|
+
24: "BINARY_COLD",
|
|
123
|
+
25: "BINARY_CONNECTIVITY",
|
|
124
|
+
26: "BINARY_DOOR",
|
|
125
|
+
27: "BINARY_GARAGE_DOOR",
|
|
126
|
+
28: "BINARY_GAS",
|
|
127
|
+
29: "BINARY_HEAT",
|
|
128
|
+
30: "BINARY_LIGHT",
|
|
129
|
+
31: "BINARY_LOCK",
|
|
130
|
+
32: "BINARY_MOISTURE",
|
|
131
|
+
33: "BINARY_MOTION",
|
|
132
|
+
34: "BINARY_MOVING",
|
|
133
|
+
35: "BINARY_OCCUPANCY",
|
|
134
|
+
36: "BINARY_PLUG",
|
|
135
|
+
37: "BINARY_PRESENCE",
|
|
136
|
+
38: "BINARY_PROBLEM",
|
|
137
|
+
39: "BINARY_RUNNING",
|
|
138
|
+
40: "BINARY_SAFETY",
|
|
139
|
+
41: "BINARY_SMOKE",
|
|
140
|
+
42: "BINARY_SOUND",
|
|
141
|
+
43: "BINARY_TAMPER",
|
|
142
|
+
44: "BINARY_VIBRATION",
|
|
143
|
+
45: "BINARY_WINDOW",
|
|
144
|
+
46: "SENSOR_HUMIDITY",
|
|
145
|
+
47: "SENSOR_MOISTURE",
|
|
146
|
+
58: "EVENT_BUTTON",
|
|
147
|
+
60: "EVENT_DIMMER",
|
|
148
|
+
61: "SENSOR_COUNT_UINT16",
|
|
149
|
+
62: "SENSOR_COUNT_UINT32",
|
|
150
|
+
63: "SENSOR_ROTATION_0_1",
|
|
151
|
+
64: "SENSOR_DISTANCE_MM",
|
|
152
|
+
65: "SENSOR_DISTANCE_M_0_1",
|
|
153
|
+
66: "SENSOR_DURATION_0_001",
|
|
154
|
+
67: "SENSOR_CURRENT_0_001",
|
|
155
|
+
68: "SENSOR_SPEED_0_01",
|
|
156
|
+
69: "SENSOR_TEMPERATURE_0_1",
|
|
157
|
+
70: "SENSOR_UV_INDEX_0_1",
|
|
158
|
+
71: "SENSOR_VOLUME_0_1",
|
|
159
|
+
72: "SENSOR_VOLUME",
|
|
160
|
+
73: "SENSOR_VOLUME_FLOW_RATE_0_001",
|
|
161
|
+
74: "SENSOR_VOLTAGE_0_1",
|
|
162
|
+
75: "SENSOR_GAS",
|
|
163
|
+
76: "SENSOR_GAS_UINT32",
|
|
164
|
+
77: "SENSOR_ENERGY_0_001_UINT32",
|
|
165
|
+
78: "SENSOR_VOLUME_0_001",
|
|
166
|
+
79: "SENSOR_WATER",
|
|
167
|
+
80: "SENSOR_TIMESTAMP",
|
|
168
|
+
81: "SENSOR_ACCELERATION",
|
|
169
|
+
82: "SENSOR_GYROSCOPE",
|
|
170
|
+
83: "SENSOR_TEXT",
|
|
171
|
+
84: "SENSOR_RAW",
|
|
172
|
+
85: "SENSOR_VOLUME_STORAGE",
|
|
173
|
+
240: "DEVICE_TYPE",
|
|
174
|
+
241: "DEVICE_FW_VERSION_UINT32",
|
|
175
|
+
242: "DEVICE_FW_VERSION_UINT24",
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
BthomeServiceData.ButtonEventType = Object.freeze({
|
|
179
|
+
NONE: 0,
|
|
180
|
+
PRESS: 1,
|
|
181
|
+
DOUBLE_PRESS: 2,
|
|
182
|
+
TRIPLE_PRESS: 3,
|
|
183
|
+
LONG_PRESS: 4,
|
|
184
|
+
LONG_DOUBLE_PRESS: 5,
|
|
185
|
+
LONG_TRIPLE_PRESS: 6,
|
|
186
|
+
HOLD_PRESS: 128,
|
|
187
|
+
|
|
188
|
+
0: "NONE",
|
|
189
|
+
1: "PRESS",
|
|
190
|
+
2: "DOUBLE_PRESS",
|
|
191
|
+
3: "TRIPLE_PRESS",
|
|
192
|
+
4: "LONG_PRESS",
|
|
193
|
+
5: "LONG_DOUBLE_PRESS",
|
|
194
|
+
6: "LONG_TRIPLE_PRESS",
|
|
195
|
+
128: "HOLD_PRESS",
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
BthomeServiceData.DimmerEventType = Object.freeze({
|
|
199
|
+
NONE: 0,
|
|
200
|
+
ROTATE_LEFT: 1,
|
|
201
|
+
ROTATE_RIGHT: 2,
|
|
202
|
+
|
|
203
|
+
0: "NONE",
|
|
204
|
+
1: "ROTATE_LEFT",
|
|
205
|
+
2: "ROTATE_RIGHT",
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
function BthomeServiceData(_io, _parent, _root) {
|
|
209
|
+
this._io = _io;
|
|
210
|
+
this._parent = _parent;
|
|
211
|
+
this._root = _root || this;
|
|
212
|
+
|
|
213
|
+
this._read();
|
|
214
|
+
}
|
|
215
|
+
BthomeServiceData.prototype._read = function() {
|
|
216
|
+
this.deviceInformation = new BthomeDeviceInformation(this._io, this, this._root);
|
|
217
|
+
if (this.deviceInformation.macIncluded) {
|
|
218
|
+
this.macReversed = this._io.readBytes(6);
|
|
219
|
+
}
|
|
220
|
+
if ( ((this.deviceInformation.bthomeVersion == 2) && (this.deviceInformation.encryption == false)) ) {
|
|
221
|
+
this.measurement = [];
|
|
222
|
+
var i = 0;
|
|
223
|
+
while (!this._io.isEof()) {
|
|
224
|
+
this.measurement.push(new BthomeMeasurement(this._io, this, this._root));
|
|
225
|
+
i++;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if ( ((this.deviceInformation.bthomeVersion == 2) && (this.deviceInformation.encryption == true)) ) {
|
|
229
|
+
this.ciphertext = this._io.readBytes((((this._io.size - this._io.pos) - 4) - 4));
|
|
230
|
+
}
|
|
231
|
+
if ( ((this.deviceInformation.bthomeVersion == 2) && (this.deviceInformation.encryption == true)) ) {
|
|
232
|
+
this.counter = this._io.readU4be();
|
|
233
|
+
}
|
|
234
|
+
if ( ((this.deviceInformation.bthomeVersion == 2) && (this.deviceInformation.encryption == true)) ) {
|
|
235
|
+
this.mic = this._io.readU4be();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
var BthomeSensorEnergy0001 = BthomeServiceData.BthomeSensorEnergy0001 = (function() {
|
|
240
|
+
function BthomeSensorEnergy0001(_io, _parent, _root) {
|
|
241
|
+
this._io = _io;
|
|
242
|
+
this._parent = _parent;
|
|
243
|
+
this._root = _root || this;
|
|
244
|
+
|
|
245
|
+
this._read();
|
|
246
|
+
}
|
|
247
|
+
BthomeSensorEnergy0001.prototype._read = function() {
|
|
248
|
+
this.value = new U3(this._io, this, this._root);
|
|
249
|
+
}
|
|
250
|
+
Object.defineProperty(BthomeSensorEnergy0001.prototype, 'energy', {
|
|
251
|
+
get: function() {
|
|
252
|
+
if (this._m_energy !== undefined)
|
|
253
|
+
return this._m_energy;
|
|
254
|
+
this._m_energy = (this.value.value * 0.001);
|
|
255
|
+
return this._m_energy;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(BthomeSensorEnergy0001.prototype, 'unit', {
|
|
259
|
+
get: function() {
|
|
260
|
+
if (this._m_unit !== undefined)
|
|
261
|
+
return this._m_unit;
|
|
262
|
+
this._m_unit = "kWh";
|
|
263
|
+
return this._m_unit;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
return BthomeSensorEnergy0001;
|
|
268
|
+
})();
|
|
269
|
+
|
|
270
|
+
var BthomeSensorCountUint32 = BthomeServiceData.BthomeSensorCountUint32 = (function() {
|
|
271
|
+
function BthomeSensorCountUint32(_io, _parent, _root) {
|
|
272
|
+
this._io = _io;
|
|
273
|
+
this._parent = _parent;
|
|
274
|
+
this._root = _root || this;
|
|
275
|
+
|
|
276
|
+
this._read();
|
|
277
|
+
}
|
|
278
|
+
BthomeSensorCountUint32.prototype._read = function() {
|
|
279
|
+
this.count = this._io.readU4le();
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return BthomeSensorCountUint32;
|
|
283
|
+
})();
|
|
284
|
+
|
|
285
|
+
var BthomeSensorBattery = BthomeServiceData.BthomeSensorBattery = (function() {
|
|
286
|
+
function BthomeSensorBattery(_io, _parent, _root) {
|
|
287
|
+
this._io = _io;
|
|
288
|
+
this._parent = _parent;
|
|
289
|
+
this._root = _root || this;
|
|
290
|
+
|
|
291
|
+
this._read();
|
|
292
|
+
}
|
|
293
|
+
BthomeSensorBattery.prototype._read = function() {
|
|
294
|
+
this.battery = this._io.readU1();
|
|
295
|
+
}
|
|
296
|
+
Object.defineProperty(BthomeSensorBattery.prototype, 'unit', {
|
|
297
|
+
get: function() {
|
|
298
|
+
if (this._m_unit !== undefined)
|
|
299
|
+
return this._m_unit;
|
|
300
|
+
this._m_unit = "%";
|
|
301
|
+
return this._m_unit;
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
return BthomeSensorBattery;
|
|
306
|
+
})();
|
|
307
|
+
|
|
308
|
+
var BthomeSensorCo2 = BthomeServiceData.BthomeSensorCo2 = (function() {
|
|
309
|
+
function BthomeSensorCo2(_io, _parent, _root) {
|
|
310
|
+
this._io = _io;
|
|
311
|
+
this._parent = _parent;
|
|
312
|
+
this._root = _root || this;
|
|
313
|
+
|
|
314
|
+
this._read();
|
|
315
|
+
}
|
|
316
|
+
BthomeSensorCo2.prototype._read = function() {
|
|
317
|
+
this.co2 = this._io.readU2le();
|
|
318
|
+
}
|
|
319
|
+
Object.defineProperty(BthomeSensorCo2.prototype, 'unit', {
|
|
320
|
+
get: function() {
|
|
321
|
+
if (this._m_unit !== undefined)
|
|
322
|
+
return this._m_unit;
|
|
323
|
+
this._m_unit = "ppm";
|
|
324
|
+
return this._m_unit;
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
return BthomeSensorCo2;
|
|
329
|
+
})();
|
|
330
|
+
|
|
331
|
+
var BthomeSensorVoltage0001 = BthomeServiceData.BthomeSensorVoltage0001 = (function() {
|
|
332
|
+
function BthomeSensorVoltage0001(_io, _parent, _root) {
|
|
333
|
+
this._io = _io;
|
|
334
|
+
this._parent = _parent;
|
|
335
|
+
this._root = _root || this;
|
|
336
|
+
|
|
337
|
+
this._read();
|
|
338
|
+
}
|
|
339
|
+
BthomeSensorVoltage0001.prototype._read = function() {
|
|
340
|
+
this.value = this._io.readU2le();
|
|
341
|
+
}
|
|
342
|
+
Object.defineProperty(BthomeSensorVoltage0001.prototype, 'voltage', {
|
|
343
|
+
get: function() {
|
|
344
|
+
if (this._m_voltage !== undefined)
|
|
345
|
+
return this._m_voltage;
|
|
346
|
+
this._m_voltage = (this.value * 0.001);
|
|
347
|
+
return this._m_voltage;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
Object.defineProperty(BthomeSensorVoltage0001.prototype, 'unit', {
|
|
351
|
+
get: function() {
|
|
352
|
+
if (this._m_unit !== undefined)
|
|
353
|
+
return this._m_unit;
|
|
354
|
+
this._m_unit = "V";
|
|
355
|
+
return this._m_unit;
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
return BthomeSensorVoltage0001;
|
|
360
|
+
})();
|
|
361
|
+
|
|
362
|
+
var BthomeDeviceInformation = BthomeServiceData.BthomeDeviceInformation = (function() {
|
|
363
|
+
function BthomeDeviceInformation(_io, _parent, _root) {
|
|
364
|
+
this._io = _io;
|
|
365
|
+
this._parent = _parent;
|
|
366
|
+
this._root = _root || this;
|
|
367
|
+
|
|
368
|
+
this._read();
|
|
369
|
+
}
|
|
370
|
+
BthomeDeviceInformation.prototype._read = function() {
|
|
371
|
+
this.encryption = this._io.readBitsIntLe(1) != 0;
|
|
372
|
+
this.macIncluded = this._io.readBitsIntLe(1) != 0;
|
|
373
|
+
this.triggerBased = this._io.readBitsIntLe(1) != 0;
|
|
374
|
+
this.reservedForFutureUse = this._io.readBitsIntLe(2);
|
|
375
|
+
this.bthomeVersion = this._io.readBitsIntLe(3);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return BthomeDeviceInformation;
|
|
379
|
+
})();
|
|
380
|
+
|
|
381
|
+
var BthomeBinaryWindow = BthomeServiceData.BthomeBinaryWindow = (function() {
|
|
382
|
+
function BthomeBinaryWindow(_io, _parent, _root) {
|
|
383
|
+
this._io = _io;
|
|
384
|
+
this._parent = _parent;
|
|
385
|
+
this._root = _root || this;
|
|
386
|
+
|
|
387
|
+
this._read();
|
|
388
|
+
}
|
|
389
|
+
BthomeBinaryWindow.prototype._read = function() {
|
|
390
|
+
this.window = new Bool8(this._io, this, this._root);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return BthomeBinaryWindow;
|
|
394
|
+
})();
|
|
395
|
+
|
|
396
|
+
var BthomeSensorCurrent0001 = BthomeServiceData.BthomeSensorCurrent0001 = (function() {
|
|
397
|
+
function BthomeSensorCurrent0001(_io, _parent, _root) {
|
|
398
|
+
this._io = _io;
|
|
399
|
+
this._parent = _parent;
|
|
400
|
+
this._root = _root || this;
|
|
401
|
+
|
|
402
|
+
this._read();
|
|
403
|
+
}
|
|
404
|
+
BthomeSensorCurrent0001.prototype._read = function() {
|
|
405
|
+
this.value = this._io.readU2le();
|
|
406
|
+
}
|
|
407
|
+
Object.defineProperty(BthomeSensorCurrent0001.prototype, 'current', {
|
|
408
|
+
get: function() {
|
|
409
|
+
if (this._m_current !== undefined)
|
|
410
|
+
return this._m_current;
|
|
411
|
+
this._m_current = (this.value * 0.001);
|
|
412
|
+
return this._m_current;
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
Object.defineProperty(BthomeSensorCurrent0001.prototype, 'unit', {
|
|
416
|
+
get: function() {
|
|
417
|
+
if (this._m_unit !== undefined)
|
|
418
|
+
return this._m_unit;
|
|
419
|
+
this._m_unit = "A";
|
|
420
|
+
return this._m_unit;
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
return BthomeSensorCurrent0001;
|
|
425
|
+
})();
|
|
426
|
+
|
|
427
|
+
var BthomeSensorVolume01 = BthomeServiceData.BthomeSensorVolume01 = (function() {
|
|
428
|
+
function BthomeSensorVolume01(_io, _parent, _root) {
|
|
429
|
+
this._io = _io;
|
|
430
|
+
this._parent = _parent;
|
|
431
|
+
this._root = _root || this;
|
|
432
|
+
|
|
433
|
+
this._read();
|
|
434
|
+
}
|
|
435
|
+
BthomeSensorVolume01.prototype._read = function() {
|
|
436
|
+
this.value = this._io.readU2le();
|
|
437
|
+
}
|
|
438
|
+
Object.defineProperty(BthomeSensorVolume01.prototype, 'volume', {
|
|
439
|
+
get: function() {
|
|
440
|
+
if (this._m_volume !== undefined)
|
|
441
|
+
return this._m_volume;
|
|
442
|
+
this._m_volume = (this.value * 0.1);
|
|
443
|
+
return this._m_volume;
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
Object.defineProperty(BthomeSensorVolume01.prototype, 'unit', {
|
|
447
|
+
get: function() {
|
|
448
|
+
if (this._m_unit !== undefined)
|
|
449
|
+
return this._m_unit;
|
|
450
|
+
this._m_unit = "L";
|
|
451
|
+
return this._m_unit;
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
return BthomeSensorVolume01;
|
|
456
|
+
})();
|
|
457
|
+
|
|
458
|
+
var BthomeBinaryConnectivity = BthomeServiceData.BthomeBinaryConnectivity = (function() {
|
|
459
|
+
function BthomeBinaryConnectivity(_io, _parent, _root) {
|
|
460
|
+
this._io = _io;
|
|
461
|
+
this._parent = _parent;
|
|
462
|
+
this._root = _root || this;
|
|
463
|
+
|
|
464
|
+
this._read();
|
|
465
|
+
}
|
|
466
|
+
BthomeBinaryConnectivity.prototype._read = function() {
|
|
467
|
+
this.connectivity = new Bool8(this._io, this, this._root);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
return BthomeBinaryConnectivity;
|
|
471
|
+
})();
|
|
472
|
+
|
|
473
|
+
var BthomeSensorPm10 = BthomeServiceData.BthomeSensorPm10 = (function() {
|
|
474
|
+
function BthomeSensorPm10(_io, _parent, _root) {
|
|
475
|
+
this._io = _io;
|
|
476
|
+
this._parent = _parent;
|
|
477
|
+
this._root = _root || this;
|
|
478
|
+
|
|
479
|
+
this._read();
|
|
480
|
+
}
|
|
481
|
+
BthomeSensorPm10.prototype._read = function() {
|
|
482
|
+
this.pm10 = this._io.readU2le();
|
|
483
|
+
}
|
|
484
|
+
Object.defineProperty(BthomeSensorPm10.prototype, 'unit', {
|
|
485
|
+
get: function() {
|
|
486
|
+
if (this._m_unit !== undefined)
|
|
487
|
+
return this._m_unit;
|
|
488
|
+
this._m_unit = "\xb5g/m\xb3";
|
|
489
|
+
return this._m_unit;
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
return BthomeSensorPm10;
|
|
494
|
+
})();
|
|
495
|
+
|
|
496
|
+
var BthomeBinarySound = BthomeServiceData.BthomeBinarySound = (function() {
|
|
497
|
+
function BthomeBinarySound(_io, _parent, _root) {
|
|
498
|
+
this._io = _io;
|
|
499
|
+
this._parent = _parent;
|
|
500
|
+
this._root = _root || this;
|
|
501
|
+
|
|
502
|
+
this._read();
|
|
503
|
+
}
|
|
504
|
+
BthomeBinarySound.prototype._read = function() {
|
|
505
|
+
this.sound = new Bool8(this._io, this, this._root);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
return BthomeBinarySound;
|
|
509
|
+
})();
|
|
510
|
+
|
|
511
|
+
var BthomeSensorAcceleration = BthomeServiceData.BthomeSensorAcceleration = (function() {
|
|
512
|
+
function BthomeSensorAcceleration(_io, _parent, _root) {
|
|
513
|
+
this._io = _io;
|
|
514
|
+
this._parent = _parent;
|
|
515
|
+
this._root = _root || this;
|
|
516
|
+
|
|
517
|
+
this._read();
|
|
518
|
+
}
|
|
519
|
+
BthomeSensorAcceleration.prototype._read = function() {
|
|
520
|
+
this.value = this._io.readU2le();
|
|
521
|
+
}
|
|
522
|
+
Object.defineProperty(BthomeSensorAcceleration.prototype, 'acceleration', {
|
|
523
|
+
get: function() {
|
|
524
|
+
if (this._m_acceleration !== undefined)
|
|
525
|
+
return this._m_acceleration;
|
|
526
|
+
this._m_acceleration = (this.value * 0.001);
|
|
527
|
+
return this._m_acceleration;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
Object.defineProperty(BthomeSensorAcceleration.prototype, 'unit', {
|
|
531
|
+
get: function() {
|
|
532
|
+
if (this._m_unit !== undefined)
|
|
533
|
+
return this._m_unit;
|
|
534
|
+
this._m_unit = "m/s\xb2";
|
|
535
|
+
return this._m_unit;
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
return BthomeSensorAcceleration;
|
|
540
|
+
})();
|
|
541
|
+
|
|
542
|
+
var BthomeEventDimmer = BthomeServiceData.BthomeEventDimmer = (function() {
|
|
543
|
+
function BthomeEventDimmer(_io, _parent, _root) {
|
|
544
|
+
this._io = _io;
|
|
545
|
+
this._parent = _parent;
|
|
546
|
+
this._root = _root || this;
|
|
547
|
+
|
|
548
|
+
this._read();
|
|
549
|
+
}
|
|
550
|
+
BthomeEventDimmer.prototype._read = function() {
|
|
551
|
+
this.event = this._io.readU1();
|
|
552
|
+
this.steps = this._io.readU1();
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return BthomeEventDimmer;
|
|
556
|
+
})();
|
|
557
|
+
|
|
558
|
+
var BthomeDeviceType = BthomeServiceData.BthomeDeviceType = (function() {
|
|
559
|
+
function BthomeDeviceType(_io, _parent, _root) {
|
|
560
|
+
this._io = _io;
|
|
561
|
+
this._parent = _parent;
|
|
562
|
+
this._root = _root || this;
|
|
563
|
+
|
|
564
|
+
this._read();
|
|
565
|
+
}
|
|
566
|
+
BthomeDeviceType.prototype._read = function() {
|
|
567
|
+
this.deviceTypeId = this._io.readU2le();
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
return BthomeDeviceType;
|
|
571
|
+
})();
|
|
572
|
+
|
|
573
|
+
var BthomeSensorGasUint32 = BthomeServiceData.BthomeSensorGasUint32 = (function() {
|
|
574
|
+
function BthomeSensorGasUint32(_io, _parent, _root) {
|
|
575
|
+
this._io = _io;
|
|
576
|
+
this._parent = _parent;
|
|
577
|
+
this._root = _root || this;
|
|
578
|
+
|
|
579
|
+
this._read();
|
|
580
|
+
}
|
|
581
|
+
BthomeSensorGasUint32.prototype._read = function() {
|
|
582
|
+
this.value = this._io.readU4le();
|
|
583
|
+
}
|
|
584
|
+
Object.defineProperty(BthomeSensorGasUint32.prototype, 'gas', {
|
|
585
|
+
get: function() {
|
|
586
|
+
if (this._m_gas !== undefined)
|
|
587
|
+
return this._m_gas;
|
|
588
|
+
this._m_gas = (this.value * 0.001);
|
|
589
|
+
return this._m_gas;
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
Object.defineProperty(BthomeSensorGasUint32.prototype, 'unit', {
|
|
593
|
+
get: function() {
|
|
594
|
+
if (this._m_unit !== undefined)
|
|
595
|
+
return this._m_unit;
|
|
596
|
+
this._m_unit = "m\xb3";
|
|
597
|
+
return this._m_unit;
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
return BthomeSensorGasUint32;
|
|
602
|
+
})();
|
|
603
|
+
|
|
604
|
+
var BthomeSensorPm25 = BthomeServiceData.BthomeSensorPm25 = (function() {
|
|
605
|
+
function BthomeSensorPm25(_io, _parent, _root) {
|
|
606
|
+
this._io = _io;
|
|
607
|
+
this._parent = _parent;
|
|
608
|
+
this._root = _root || this;
|
|
609
|
+
|
|
610
|
+
this._read();
|
|
611
|
+
}
|
|
612
|
+
BthomeSensorPm25.prototype._read = function() {
|
|
613
|
+
this.pm25 = this._io.readU2le();
|
|
614
|
+
}
|
|
615
|
+
Object.defineProperty(BthomeSensorPm25.prototype, 'unit', {
|
|
616
|
+
get: function() {
|
|
617
|
+
if (this._m_unit !== undefined)
|
|
618
|
+
return this._m_unit;
|
|
619
|
+
this._m_unit = "\xb5g/m\xb3";
|
|
620
|
+
return this._m_unit;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
return BthomeSensorPm25;
|
|
625
|
+
})();
|
|
626
|
+
|
|
627
|
+
var BthomeSensorVolume = BthomeServiceData.BthomeSensorVolume = (function() {
|
|
628
|
+
function BthomeSensorVolume(_io, _parent, _root) {
|
|
629
|
+
this._io = _io;
|
|
630
|
+
this._parent = _parent;
|
|
631
|
+
this._root = _root || this;
|
|
632
|
+
|
|
633
|
+
this._read();
|
|
634
|
+
}
|
|
635
|
+
BthomeSensorVolume.prototype._read = function() {
|
|
636
|
+
this.volume = this._io.readU2le();
|
|
637
|
+
}
|
|
638
|
+
Object.defineProperty(BthomeSensorVolume.prototype, 'unit', {
|
|
639
|
+
get: function() {
|
|
640
|
+
if (this._m_unit !== undefined)
|
|
641
|
+
return this._m_unit;
|
|
642
|
+
this._m_unit = "mL";
|
|
643
|
+
return this._m_unit;
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
return BthomeSensorVolume;
|
|
648
|
+
})();
|
|
649
|
+
|
|
650
|
+
var BthomeSensorTimestamp = BthomeServiceData.BthomeSensorTimestamp = (function() {
|
|
651
|
+
function BthomeSensorTimestamp(_io, _parent, _root) {
|
|
652
|
+
this._io = _io;
|
|
653
|
+
this._parent = _parent;
|
|
654
|
+
this._root = _root || this;
|
|
655
|
+
|
|
656
|
+
this._read();
|
|
657
|
+
}
|
|
658
|
+
BthomeSensorTimestamp.prototype._read = function() {
|
|
659
|
+
this.value = this._io.readU4le();
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return BthomeSensorTimestamp;
|
|
663
|
+
})();
|
|
664
|
+
|
|
665
|
+
var BthomeBinaryMoving = BthomeServiceData.BthomeBinaryMoving = (function() {
|
|
666
|
+
function BthomeBinaryMoving(_io, _parent, _root) {
|
|
667
|
+
this._io = _io;
|
|
668
|
+
this._parent = _parent;
|
|
669
|
+
this._root = _root || this;
|
|
670
|
+
|
|
671
|
+
this._read();
|
|
672
|
+
}
|
|
673
|
+
BthomeBinaryMoving.prototype._read = function() {
|
|
674
|
+
this.moving = new Bool8(this._io, this, this._root);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
return BthomeBinaryMoving;
|
|
678
|
+
})();
|
|
679
|
+
|
|
680
|
+
var BthomeDeviceFwVersionUint24 = BthomeServiceData.BthomeDeviceFwVersionUint24 = (function() {
|
|
681
|
+
function BthomeDeviceFwVersionUint24(_io, _parent, _root) {
|
|
682
|
+
this._io = _io;
|
|
683
|
+
this._parent = _parent;
|
|
684
|
+
this._root = _root || this;
|
|
685
|
+
|
|
686
|
+
this._read();
|
|
687
|
+
}
|
|
688
|
+
BthomeDeviceFwVersionUint24.prototype._read = function() {
|
|
689
|
+
this.fwVersionPatch = this._io.readU1();
|
|
690
|
+
this.fwVersionMinor = this._io.readU1();
|
|
691
|
+
this.fwVersionMajor = this._io.readU1();
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
return BthomeDeviceFwVersionUint24;
|
|
695
|
+
})();
|
|
696
|
+
|
|
697
|
+
var BthomeMiscPacketId = BthomeServiceData.BthomeMiscPacketId = (function() {
|
|
698
|
+
function BthomeMiscPacketId(_io, _parent, _root) {
|
|
699
|
+
this._io = _io;
|
|
700
|
+
this._parent = _parent;
|
|
701
|
+
this._root = _root || this;
|
|
702
|
+
|
|
703
|
+
this._read();
|
|
704
|
+
}
|
|
705
|
+
BthomeMiscPacketId.prototype._read = function() {
|
|
706
|
+
this.packetId = this._io.readU1();
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
return BthomeMiscPacketId;
|
|
710
|
+
})();
|
|
711
|
+
|
|
712
|
+
var BthomeSensorTemperature01 = BthomeServiceData.BthomeSensor01 = (function() {
|
|
713
|
+
function BthomeSensorTemperature01(_io, _parent, _root) {
|
|
714
|
+
this._io = _io;
|
|
715
|
+
this._parent = _parent;
|
|
716
|
+
this._root = _root || this;
|
|
717
|
+
|
|
718
|
+
this._read();
|
|
719
|
+
}
|
|
720
|
+
BthomeSensorTemperature01.prototype._read = function() {
|
|
721
|
+
this.value = this._io.readS2le();
|
|
722
|
+
}
|
|
723
|
+
Object.defineProperty(BthomeSensorTemperature01.prototype, 'temperature', {
|
|
724
|
+
get: function() {
|
|
725
|
+
if (this._m_temperature !== undefined)
|
|
726
|
+
return this._m_temperature;
|
|
727
|
+
this._m_temperature = (this.value * 0.1);
|
|
728
|
+
return this._m_temperature;
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
Object.defineProperty(BthomeSensorTemperature01.prototype, 'unit', {
|
|
732
|
+
get: function() {
|
|
733
|
+
if (this._m_unit !== undefined)
|
|
734
|
+
return this._m_unit;
|
|
735
|
+
this._m_unit = "\xb0C";
|
|
736
|
+
return this._m_unit;
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
return BthomeSensorTemperature01;
|
|
741
|
+
})();
|
|
742
|
+
|
|
743
|
+
var BthomeBinaryVibration = BthomeServiceData.BthomeBinaryVibration = (function() {
|
|
744
|
+
function BthomeBinaryVibration(_io, _parent, _root) {
|
|
745
|
+
this._io = _io;
|
|
746
|
+
this._parent = _parent;
|
|
747
|
+
this._root = _root || this;
|
|
748
|
+
|
|
749
|
+
this._read();
|
|
750
|
+
}
|
|
751
|
+
BthomeBinaryVibration.prototype._read = function() {
|
|
752
|
+
this.vibration = new Bool8(this._io, this, this._root);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
return BthomeBinaryVibration;
|
|
756
|
+
})();
|
|
757
|
+
|
|
758
|
+
var BthomeBinaryBattery = BthomeServiceData.BthomeBinaryBattery = (function() {
|
|
759
|
+
function BthomeBinaryBattery(_io, _parent, _root) {
|
|
760
|
+
this._io = _io;
|
|
761
|
+
this._parent = _parent;
|
|
762
|
+
this._root = _root || this;
|
|
763
|
+
|
|
764
|
+
this._read();
|
|
765
|
+
}
|
|
766
|
+
BthomeBinaryBattery.prototype._read = function() {
|
|
767
|
+
this.battery = new Bool8(this._io, this, this._root);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
return BthomeBinaryBattery;
|
|
771
|
+
})();
|
|
772
|
+
|
|
773
|
+
var BthomeBinaryPower = BthomeServiceData.BthomeBinaryPower = (function() {
|
|
774
|
+
function BthomeBinaryPower(_io, _parent, _root) {
|
|
775
|
+
this._io = _io;
|
|
776
|
+
this._parent = _parent;
|
|
777
|
+
this._root = _root || this;
|
|
778
|
+
|
|
779
|
+
this._read();
|
|
780
|
+
}
|
|
781
|
+
BthomeBinaryPower.prototype._read = function() {
|
|
782
|
+
this.power = new Bool8(this._io, this, this._root);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
return BthomeBinaryPower;
|
|
786
|
+
})();
|
|
787
|
+
|
|
788
|
+
var BthomeSensorEnergy0001Uint32 = BthomeServiceData.BthomeSensorEnergy0001Uint32 = (function() {
|
|
789
|
+
function BthomeSensorEnergy0001Uint32(_io, _parent, _root) {
|
|
790
|
+
this._io = _io;
|
|
791
|
+
this._parent = _parent;
|
|
792
|
+
this._root = _root || this;
|
|
793
|
+
|
|
794
|
+
this._read();
|
|
795
|
+
}
|
|
796
|
+
BthomeSensorEnergy0001Uint32.prototype._read = function() {
|
|
797
|
+
this.value = this._io.readU4le();
|
|
798
|
+
}
|
|
799
|
+
Object.defineProperty(BthomeSensorEnergy0001Uint32.prototype, 'energy', {
|
|
800
|
+
get: function() {
|
|
801
|
+
if (this._m_energy !== undefined)
|
|
802
|
+
return this._m_energy;
|
|
803
|
+
this._m_energy = (this.value * 0.001);
|
|
804
|
+
return this._m_energy;
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
Object.defineProperty(BthomeSensorEnergy0001Uint32.prototype, 'unit', {
|
|
808
|
+
get: function() {
|
|
809
|
+
if (this._m_unit !== undefined)
|
|
810
|
+
return this._m_unit;
|
|
811
|
+
this._m_unit = "kWh";
|
|
812
|
+
return this._m_unit;
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
|
|
816
|
+
return BthomeSensorEnergy0001Uint32;
|
|
817
|
+
})();
|
|
818
|
+
|
|
819
|
+
var BthomeBinaryOpening = BthomeServiceData.BthomeBinaryOpening = (function() {
|
|
820
|
+
function BthomeBinaryOpening(_io, _parent, _root) {
|
|
821
|
+
this._io = _io;
|
|
822
|
+
this._parent = _parent;
|
|
823
|
+
this._root = _root || this;
|
|
824
|
+
|
|
825
|
+
this._read();
|
|
826
|
+
}
|
|
827
|
+
BthomeBinaryOpening.prototype._read = function() {
|
|
828
|
+
this.opening = new Bool8(this._io, this, this._root);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
return BthomeBinaryOpening;
|
|
832
|
+
})();
|
|
833
|
+
|
|
834
|
+
var BthomeSensorPressure001 = BthomeServiceData.BthomeSensorPressure001 = (function() {
|
|
835
|
+
function BthomeSensorPressure001(_io, _parent, _root) {
|
|
836
|
+
this._io = _io;
|
|
837
|
+
this._parent = _parent;
|
|
838
|
+
this._root = _root || this;
|
|
839
|
+
|
|
840
|
+
this._read();
|
|
841
|
+
}
|
|
842
|
+
BthomeSensorPressure001.prototype._read = function() {
|
|
843
|
+
this.value = new U3(this._io, this, this._root);
|
|
844
|
+
}
|
|
845
|
+
Object.defineProperty(BthomeSensorPressure001.prototype, 'pressure', {
|
|
846
|
+
get: function() {
|
|
847
|
+
if (this._m_pressure !== undefined)
|
|
848
|
+
return this._m_pressure;
|
|
849
|
+
this._m_pressure = (this.value.value * 0.01);
|
|
850
|
+
return this._m_pressure;
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
Object.defineProperty(BthomeSensorPressure001.prototype, 'unit', {
|
|
854
|
+
get: function() {
|
|
855
|
+
if (this._m_unit !== undefined)
|
|
856
|
+
return this._m_unit;
|
|
857
|
+
this._m_unit = "hPa";
|
|
858
|
+
return this._m_unit;
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
return BthomeSensorPressure001;
|
|
863
|
+
})();
|
|
864
|
+
|
|
865
|
+
var BthomeEventButton = BthomeServiceData.BthomeEventButton = (function() {
|
|
866
|
+
function BthomeEventButton(_io, _parent, _root) {
|
|
867
|
+
this._io = _io;
|
|
868
|
+
this._parent = _parent;
|
|
869
|
+
this._root = _root || this;
|
|
870
|
+
|
|
871
|
+
this._read();
|
|
872
|
+
}
|
|
873
|
+
BthomeEventButton.prototype._read = function() {
|
|
874
|
+
this.event = this._io.readU1();
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
return BthomeEventButton;
|
|
878
|
+
})();
|
|
879
|
+
|
|
880
|
+
var BthomeSensorCountUint16 = BthomeServiceData.BthomeSensorCountUint16 = (function() {
|
|
881
|
+
function BthomeSensorCountUint16(_io, _parent, _root) {
|
|
882
|
+
this._io = _io;
|
|
883
|
+
this._parent = _parent;
|
|
884
|
+
this._root = _root || this;
|
|
885
|
+
|
|
886
|
+
this._read();
|
|
887
|
+
}
|
|
888
|
+
BthomeSensorCountUint16.prototype._read = function() {
|
|
889
|
+
this.count = this._io.readU2le();
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
return BthomeSensorCountUint16;
|
|
893
|
+
})();
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Data with unknown object ID are parsed as a byte array until the end
|
|
897
|
+
*/
|
|
898
|
+
|
|
899
|
+
var BthomeUnknown = BthomeServiceData.BthomeUnknown = (function() {
|
|
900
|
+
function BthomeUnknown(_io, _parent, _root) {
|
|
901
|
+
this._io = _io;
|
|
902
|
+
this._parent = _parent;
|
|
903
|
+
this._root = _root || this;
|
|
904
|
+
|
|
905
|
+
this._read();
|
|
906
|
+
}
|
|
907
|
+
BthomeUnknown.prototype._read = function() {
|
|
908
|
+
this.unknown = this._io.readBytesFull();
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
return BthomeUnknown;
|
|
912
|
+
})();
|
|
913
|
+
|
|
914
|
+
var BthomeSensorTvoc = BthomeServiceData.BthomeSensorTvoc = (function() {
|
|
915
|
+
function BthomeSensorTvoc(_io, _parent, _root) {
|
|
916
|
+
this._io = _io;
|
|
917
|
+
this._parent = _parent;
|
|
918
|
+
this._root = _root || this;
|
|
919
|
+
|
|
920
|
+
this._read();
|
|
921
|
+
}
|
|
922
|
+
BthomeSensorTvoc.prototype._read = function() {
|
|
923
|
+
this.tvoc = this._io.readU2le();
|
|
924
|
+
}
|
|
925
|
+
Object.defineProperty(BthomeSensorTvoc.prototype, 'unit', {
|
|
926
|
+
get: function() {
|
|
927
|
+
if (this._m_unit !== undefined)
|
|
928
|
+
return this._m_unit;
|
|
929
|
+
this._m_unit = "\xb5g/m\xb3";
|
|
930
|
+
return this._m_unit;
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
|
|
934
|
+
return BthomeSensorTvoc;
|
|
935
|
+
})();
|
|
936
|
+
|
|
937
|
+
var BthomeSensorVolumeStorage = BthomeServiceData.BthomeSensorVolumeStorage = (function() {
|
|
938
|
+
function BthomeSensorVolumeStorage(_io, _parent, _root) {
|
|
939
|
+
this._io = _io;
|
|
940
|
+
this._parent = _parent;
|
|
941
|
+
this._root = _root || this;
|
|
942
|
+
|
|
943
|
+
this._read();
|
|
944
|
+
}
|
|
945
|
+
BthomeSensorVolumeStorage.prototype._read = function() {
|
|
946
|
+
this.value = this._io.readU4le();
|
|
947
|
+
}
|
|
948
|
+
Object.defineProperty(BthomeSensorVolumeStorage.prototype, 'volumeStorage', {
|
|
949
|
+
get: function() {
|
|
950
|
+
if (this._m_volumeStorage !== undefined)
|
|
951
|
+
return this._m_volumeStorage;
|
|
952
|
+
this._m_volumeStorage = (this.value * 0.001);
|
|
953
|
+
return this._m_volumeStorage;
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
Object.defineProperty(BthomeSensorVolumeStorage.prototype, 'unit', {
|
|
957
|
+
get: function() {
|
|
958
|
+
if (this._m_unit !== undefined)
|
|
959
|
+
return this._m_unit;
|
|
960
|
+
this._m_unit = "L";
|
|
961
|
+
return this._m_unit;
|
|
962
|
+
}
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
return BthomeSensorVolumeStorage;
|
|
966
|
+
})();
|
|
967
|
+
|
|
968
|
+
var BthomeSensorDistanceMm = BthomeServiceData.BthomeSensorDistanceMm = (function() {
|
|
969
|
+
function BthomeSensorDistanceMm(_io, _parent, _root) {
|
|
970
|
+
this._io = _io;
|
|
971
|
+
this._parent = _parent;
|
|
972
|
+
this._root = _root || this;
|
|
973
|
+
|
|
974
|
+
this._read();
|
|
975
|
+
}
|
|
976
|
+
BthomeSensorDistanceMm.prototype._read = function() {
|
|
977
|
+
this.distance = this._io.readU2le();
|
|
978
|
+
}
|
|
979
|
+
Object.defineProperty(BthomeSensorDistanceMm.prototype, 'unit', {
|
|
980
|
+
get: function() {
|
|
981
|
+
if (this._m_unit !== undefined)
|
|
982
|
+
return this._m_unit;
|
|
983
|
+
this._m_unit = "mm";
|
|
984
|
+
return this._m_unit;
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
return BthomeSensorDistanceMm;
|
|
989
|
+
})();
|
|
990
|
+
|
|
991
|
+
var BthomeBinaryPresence = BthomeServiceData.BthomeBinaryPresence = (function() {
|
|
992
|
+
function BthomeBinaryPresence(_io, _parent, _root) {
|
|
993
|
+
this._io = _io;
|
|
994
|
+
this._parent = _parent;
|
|
995
|
+
this._root = _root || this;
|
|
996
|
+
|
|
997
|
+
this._read();
|
|
998
|
+
}
|
|
999
|
+
BthomeBinaryPresence.prototype._read = function() {
|
|
1000
|
+
this.presence = new Bool8(this._io, this, this._root);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
return BthomeBinaryPresence;
|
|
1004
|
+
})();
|
|
1005
|
+
|
|
1006
|
+
var BthomeBinaryMoisture = BthomeServiceData.BthomeBinaryMoisture = (function() {
|
|
1007
|
+
function BthomeBinaryMoisture(_io, _parent, _root) {
|
|
1008
|
+
this._io = _io;
|
|
1009
|
+
this._parent = _parent;
|
|
1010
|
+
this._root = _root || this;
|
|
1011
|
+
|
|
1012
|
+
this._read();
|
|
1013
|
+
}
|
|
1014
|
+
BthomeBinaryMoisture.prototype._read = function() {
|
|
1015
|
+
this.moisture = new Bool8(this._io, this, this._root);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
return BthomeBinaryMoisture;
|
|
1019
|
+
})();
|
|
1020
|
+
|
|
1021
|
+
var BthomeSensorGas = BthomeServiceData.BthomeSensorGas = (function() {
|
|
1022
|
+
function BthomeSensorGas(_io, _parent, _root) {
|
|
1023
|
+
this._io = _io;
|
|
1024
|
+
this._parent = _parent;
|
|
1025
|
+
this._root = _root || this;
|
|
1026
|
+
|
|
1027
|
+
this._read();
|
|
1028
|
+
}
|
|
1029
|
+
BthomeSensorGas.prototype._read = function() {
|
|
1030
|
+
this.value = new U3(this._io, this, this._root);
|
|
1031
|
+
}
|
|
1032
|
+
Object.defineProperty(BthomeSensorGas.prototype, 'gas', {
|
|
1033
|
+
get: function() {
|
|
1034
|
+
if (this._m_gas !== undefined)
|
|
1035
|
+
return this._m_gas;
|
|
1036
|
+
this._m_gas = (this.value.value * 0.001);
|
|
1037
|
+
return this._m_gas;
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
Object.defineProperty(BthomeSensorGas.prototype, 'unit', {
|
|
1041
|
+
get: function() {
|
|
1042
|
+
if (this._m_unit !== undefined)
|
|
1043
|
+
return this._m_unit;
|
|
1044
|
+
this._m_unit = "m\xb3";
|
|
1045
|
+
return this._m_unit;
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
return BthomeSensorGas;
|
|
1050
|
+
})();
|
|
1051
|
+
|
|
1052
|
+
var BthomeSensorIlluminance001 = BthomeServiceData.BthomeSensorIlluminance001 = (function() {
|
|
1053
|
+
function BthomeSensorIlluminance001(_io, _parent, _root) {
|
|
1054
|
+
this._io = _io;
|
|
1055
|
+
this._parent = _parent;
|
|
1056
|
+
this._root = _root || this;
|
|
1057
|
+
|
|
1058
|
+
this._read();
|
|
1059
|
+
}
|
|
1060
|
+
BthomeSensorIlluminance001.prototype._read = function() {
|
|
1061
|
+
this.value = new U3(this._io, this, this._root);
|
|
1062
|
+
}
|
|
1063
|
+
Object.defineProperty(BthomeSensorIlluminance001.prototype, 'illuminance', {
|
|
1064
|
+
get: function() {
|
|
1065
|
+
if (this._m_illuminance !== undefined)
|
|
1066
|
+
return this._m_illuminance;
|
|
1067
|
+
this._m_illuminance = (this.value.value * 0.01);
|
|
1068
|
+
return this._m_illuminance;
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
Object.defineProperty(BthomeSensorIlluminance001.prototype, 'unit', {
|
|
1072
|
+
get: function() {
|
|
1073
|
+
if (this._m_unit !== undefined)
|
|
1074
|
+
return this._m_unit;
|
|
1075
|
+
this._m_unit = "lux";
|
|
1076
|
+
return this._m_unit;
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
|
|
1080
|
+
return BthomeSensorIlluminance001;
|
|
1081
|
+
})();
|
|
1082
|
+
|
|
1083
|
+
var BthomeDeviceFwVersionUint32 = BthomeServiceData.BthomeDeviceFwVersionUint32 = (function() {
|
|
1084
|
+
function BthomeDeviceFwVersionUint32(_io, _parent, _root) {
|
|
1085
|
+
this._io = _io;
|
|
1086
|
+
this._parent = _parent;
|
|
1087
|
+
this._root = _root || this;
|
|
1088
|
+
|
|
1089
|
+
this._read();
|
|
1090
|
+
}
|
|
1091
|
+
BthomeDeviceFwVersionUint32.prototype._read = function() {
|
|
1092
|
+
this.fwVersionBuild = this._io.readU1();
|
|
1093
|
+
this.fwVersionPatch = this._io.readU1();
|
|
1094
|
+
this.fwVersionMinor = this._io.readU1();
|
|
1095
|
+
this.fwVersionMajor = this._io.readU1();
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
return BthomeDeviceFwVersionUint32;
|
|
1099
|
+
})();
|
|
1100
|
+
|
|
1101
|
+
var BthomeSensorMassLb001 = BthomeServiceData.BthomeSensorMassLb001 = (function() {
|
|
1102
|
+
function BthomeSensorMassLb001(_io, _parent, _root) {
|
|
1103
|
+
this._io = _io;
|
|
1104
|
+
this._parent = _parent;
|
|
1105
|
+
this._root = _root || this;
|
|
1106
|
+
|
|
1107
|
+
this._read();
|
|
1108
|
+
}
|
|
1109
|
+
BthomeSensorMassLb001.prototype._read = function() {
|
|
1110
|
+
this.value = this._io.readU2le();
|
|
1111
|
+
}
|
|
1112
|
+
Object.defineProperty(BthomeSensorMassLb001.prototype, 'mass', {
|
|
1113
|
+
get: function() {
|
|
1114
|
+
if (this._m_mass !== undefined)
|
|
1115
|
+
return this._m_mass;
|
|
1116
|
+
this._m_mass = (this.value * 0.01);
|
|
1117
|
+
return this._m_mass;
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
Object.defineProperty(BthomeSensorMassLb001.prototype, 'unit', {
|
|
1121
|
+
get: function() {
|
|
1122
|
+
if (this._m_unit !== undefined)
|
|
1123
|
+
return this._m_unit;
|
|
1124
|
+
this._m_unit = "lb";
|
|
1125
|
+
return this._m_unit;
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
return BthomeSensorMassLb001;
|
|
1130
|
+
})();
|
|
1131
|
+
|
|
1132
|
+
var BthomeSensorTemperature001 = BthomeServiceData.BthomeSensorTemperature001 = (function() {
|
|
1133
|
+
function BthomeSensorTemperature001(_io, _parent, _root) {
|
|
1134
|
+
this._io = _io;
|
|
1135
|
+
this._parent = _parent;
|
|
1136
|
+
this._root = _root || this;
|
|
1137
|
+
|
|
1138
|
+
this._read();
|
|
1139
|
+
}
|
|
1140
|
+
BthomeSensorTemperature001.prototype._read = function() {
|
|
1141
|
+
this.value = this._io.readS2le();
|
|
1142
|
+
}
|
|
1143
|
+
Object.defineProperty(BthomeSensorTemperature001.prototype, 'temperature', {
|
|
1144
|
+
get: function() {
|
|
1145
|
+
if (this._m_temperature !== undefined)
|
|
1146
|
+
return this._m_temperature;
|
|
1147
|
+
this._m_temperature = (this.value * 0.01);
|
|
1148
|
+
return this._m_temperature;
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
Object.defineProperty(BthomeSensorTemperature001.prototype, 'unit', {
|
|
1152
|
+
get: function() {
|
|
1153
|
+
if (this._m_unit !== undefined)
|
|
1154
|
+
return this._m_unit;
|
|
1155
|
+
this._m_unit = "\xb0C";
|
|
1156
|
+
return this._m_unit;
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1159
|
+
|
|
1160
|
+
return BthomeSensorTemperature001;
|
|
1161
|
+
})();
|
|
1162
|
+
|
|
1163
|
+
var BthomeBinaryCold = BthomeServiceData.BthomeBinaryCold = (function() {
|
|
1164
|
+
function BthomeBinaryCold(_io, _parent, _root) {
|
|
1165
|
+
this._io = _io;
|
|
1166
|
+
this._parent = _parent;
|
|
1167
|
+
this._root = _root || this;
|
|
1168
|
+
|
|
1169
|
+
this._read();
|
|
1170
|
+
}
|
|
1171
|
+
BthomeBinaryCold.prototype._read = function() {
|
|
1172
|
+
this.cold = new Bool8(this._io, this, this._root);
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
return BthomeBinaryCold;
|
|
1176
|
+
})();
|
|
1177
|
+
|
|
1178
|
+
var Bool8 = BthomeServiceData.Bool8 = (function() {
|
|
1179
|
+
function Bool8(_io, _parent, _root) {
|
|
1180
|
+
this._io = _io;
|
|
1181
|
+
this._parent = _parent;
|
|
1182
|
+
this._root = _root || this;
|
|
1183
|
+
|
|
1184
|
+
this._read();
|
|
1185
|
+
}
|
|
1186
|
+
Bool8.prototype._read = function() {
|
|
1187
|
+
this.intValue = this._io.readU1();
|
|
1188
|
+
}
|
|
1189
|
+
Object.defineProperty(Bool8.prototype, 'value', {
|
|
1190
|
+
get: function() {
|
|
1191
|
+
if (this._m_value !== undefined)
|
|
1192
|
+
return this._m_value;
|
|
1193
|
+
this._m_value = ((this.intValue & 1) == 1 ? true : false);
|
|
1194
|
+
return this._m_value;
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
return Bool8;
|
|
1199
|
+
})();
|
|
1200
|
+
|
|
1201
|
+
var BthomeBinaryHeat = BthomeServiceData.BthomeBinaryHeat = (function() {
|
|
1202
|
+
function BthomeBinaryHeat(_io, _parent, _root) {
|
|
1203
|
+
this._io = _io;
|
|
1204
|
+
this._parent = _parent;
|
|
1205
|
+
this._root = _root || this;
|
|
1206
|
+
|
|
1207
|
+
this._read();
|
|
1208
|
+
}
|
|
1209
|
+
BthomeBinaryHeat.prototype._read = function() {
|
|
1210
|
+
this.heat = new Bool8(this._io, this, this._root);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
return BthomeBinaryHeat;
|
|
1214
|
+
})();
|
|
1215
|
+
|
|
1216
|
+
var BthomeBinaryDoor = BthomeServiceData.BthomeBinaryDoor = (function() {
|
|
1217
|
+
function BthomeBinaryDoor(_io, _parent, _root) {
|
|
1218
|
+
this._io = _io;
|
|
1219
|
+
this._parent = _parent;
|
|
1220
|
+
this._root = _root || this;
|
|
1221
|
+
|
|
1222
|
+
this._read();
|
|
1223
|
+
}
|
|
1224
|
+
BthomeBinaryDoor.prototype._read = function() {
|
|
1225
|
+
this.door = new Bool8(this._io, this, this._root);
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
return BthomeBinaryDoor;
|
|
1229
|
+
})();
|
|
1230
|
+
|
|
1231
|
+
var BthomeBinaryLock = BthomeServiceData.BthomeBinaryLock = (function() {
|
|
1232
|
+
function BthomeBinaryLock(_io, _parent, _root) {
|
|
1233
|
+
this._io = _io;
|
|
1234
|
+
this._parent = _parent;
|
|
1235
|
+
this._root = _root || this;
|
|
1236
|
+
|
|
1237
|
+
this._read();
|
|
1238
|
+
}
|
|
1239
|
+
BthomeBinaryLock.prototype._read = function() {
|
|
1240
|
+
this.lock = new Bool8(this._io, this, this._root);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
return BthomeBinaryLock;
|
|
1244
|
+
})();
|
|
1245
|
+
|
|
1246
|
+
var U3 = BthomeServiceData.U3 = (function() {
|
|
1247
|
+
function U3(_io, _parent, _root) {
|
|
1248
|
+
this._io = _io;
|
|
1249
|
+
this._parent = _parent;
|
|
1250
|
+
this._root = _root || this;
|
|
1251
|
+
|
|
1252
|
+
this._read();
|
|
1253
|
+
}
|
|
1254
|
+
U3.prototype._read = function() {
|
|
1255
|
+
this.lowByte = this._io.readU1();
|
|
1256
|
+
this.middleByte = this._io.readU1();
|
|
1257
|
+
this.highByte = this._io.readU1();
|
|
1258
|
+
}
|
|
1259
|
+
Object.defineProperty(U3.prototype, 'value', {
|
|
1260
|
+
get: function() {
|
|
1261
|
+
if (this._m_value !== undefined)
|
|
1262
|
+
return this._m_value;
|
|
1263
|
+
this._m_value = ((this.lowByte | (this.middleByte << 8)) | (this.highByte << 16));
|
|
1264
|
+
return this._m_value;
|
|
1265
|
+
}
|
|
1266
|
+
});
|
|
1267
|
+
|
|
1268
|
+
return U3;
|
|
1269
|
+
})();
|
|
1270
|
+
|
|
1271
|
+
var BthomeBinaryGarageDoor = BthomeServiceData.BthomeBinaryGarageDoor = (function() {
|
|
1272
|
+
function BthomeBinaryGarageDoor(_io, _parent, _root) {
|
|
1273
|
+
this._io = _io;
|
|
1274
|
+
this._parent = _parent;
|
|
1275
|
+
this._root = _root || this;
|
|
1276
|
+
|
|
1277
|
+
this._read();
|
|
1278
|
+
}
|
|
1279
|
+
BthomeBinaryGarageDoor.prototype._read = function() {
|
|
1280
|
+
this.garageDoor = new Bool8(this._io, this, this._root);
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
return BthomeBinaryGarageDoor;
|
|
1284
|
+
})();
|
|
1285
|
+
|
|
1286
|
+
var BthomeSensorMassKg001 = BthomeServiceData.BthomeSensorMassKg001 = (function() {
|
|
1287
|
+
function BthomeSensorMassKg001(_io, _parent, _root) {
|
|
1288
|
+
this._io = _io;
|
|
1289
|
+
this._parent = _parent;
|
|
1290
|
+
this._root = _root || this;
|
|
1291
|
+
|
|
1292
|
+
this._read();
|
|
1293
|
+
}
|
|
1294
|
+
BthomeSensorMassKg001.prototype._read = function() {
|
|
1295
|
+
this.value = this._io.readU2le();
|
|
1296
|
+
}
|
|
1297
|
+
Object.defineProperty(BthomeSensorMassKg001.prototype, 'mass', {
|
|
1298
|
+
get: function() {
|
|
1299
|
+
if (this._m_mass !== undefined)
|
|
1300
|
+
return this._m_mass;
|
|
1301
|
+
this._m_mass = (this.value * 0.01);
|
|
1302
|
+
return this._m_mass;
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
Object.defineProperty(BthomeSensorMassKg001.prototype, 'unit', {
|
|
1306
|
+
get: function() {
|
|
1307
|
+
if (this._m_unit !== undefined)
|
|
1308
|
+
return this._m_unit;
|
|
1309
|
+
this._m_unit = "kg";
|
|
1310
|
+
return this._m_unit;
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
|
|
1314
|
+
return BthomeSensorMassKg001;
|
|
1315
|
+
})();
|
|
1316
|
+
|
|
1317
|
+
var BthomeSensorWater = BthomeServiceData.BthomeSensorWater = (function() {
|
|
1318
|
+
function BthomeSensorWater(_io, _parent, _root) {
|
|
1319
|
+
this._io = _io;
|
|
1320
|
+
this._parent = _parent;
|
|
1321
|
+
this._root = _root || this;
|
|
1322
|
+
|
|
1323
|
+
this._read();
|
|
1324
|
+
}
|
|
1325
|
+
BthomeSensorWater.prototype._read = function() {
|
|
1326
|
+
this.value = this._io.readU4le();
|
|
1327
|
+
}
|
|
1328
|
+
Object.defineProperty(BthomeSensorWater.prototype, 'water', {
|
|
1329
|
+
get: function() {
|
|
1330
|
+
if (this._m_water !== undefined)
|
|
1331
|
+
return this._m_water;
|
|
1332
|
+
this._m_water = (this.value * 0.001);
|
|
1333
|
+
return this._m_water;
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1336
|
+
Object.defineProperty(BthomeSensorWater.prototype, 'unit', {
|
|
1337
|
+
get: function() {
|
|
1338
|
+
if (this._m_unit !== undefined)
|
|
1339
|
+
return this._m_unit;
|
|
1340
|
+
this._m_unit = "L";
|
|
1341
|
+
return this._m_unit;
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
return BthomeSensorWater;
|
|
1346
|
+
})();
|
|
1347
|
+
|
|
1348
|
+
var BthomeSensorSpeed001 = BthomeServiceData.BthomeSensorSpeed001 = (function() {
|
|
1349
|
+
function BthomeSensorSpeed001(_io, _parent, _root) {
|
|
1350
|
+
this._io = _io;
|
|
1351
|
+
this._parent = _parent;
|
|
1352
|
+
this._root = _root || this;
|
|
1353
|
+
|
|
1354
|
+
this._read();
|
|
1355
|
+
}
|
|
1356
|
+
BthomeSensorSpeed001.prototype._read = function() {
|
|
1357
|
+
this.value = this._io.readU2le();
|
|
1358
|
+
}
|
|
1359
|
+
Object.defineProperty(BthomeSensorSpeed001.prototype, 'speed', {
|
|
1360
|
+
get: function() {
|
|
1361
|
+
if (this._m_speed !== undefined)
|
|
1362
|
+
return this._m_speed;
|
|
1363
|
+
this._m_speed = (this.value * 0.01);
|
|
1364
|
+
return this._m_speed;
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
Object.defineProperty(BthomeSensorSpeed001.prototype, 'unit', {
|
|
1368
|
+
get: function() {
|
|
1369
|
+
if (this._m_unit !== undefined)
|
|
1370
|
+
return this._m_unit;
|
|
1371
|
+
this._m_unit = "m/s";
|
|
1372
|
+
return this._m_unit;
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1375
|
+
|
|
1376
|
+
return BthomeSensorSpeed001;
|
|
1377
|
+
})();
|
|
1378
|
+
|
|
1379
|
+
var BthomeSensorRaw = BthomeServiceData.BthomeSensorRaw = (function() {
|
|
1380
|
+
function BthomeSensorRaw(_io, _parent, _root) {
|
|
1381
|
+
this._io = _io;
|
|
1382
|
+
this._parent = _parent;
|
|
1383
|
+
this._root = _root || this;
|
|
1384
|
+
|
|
1385
|
+
this._read();
|
|
1386
|
+
}
|
|
1387
|
+
BthomeSensorRaw.prototype._read = function() {
|
|
1388
|
+
this.lenValue = this._io.readU1();
|
|
1389
|
+
this.value = this._io.readBytes(this.lenValue);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
return BthomeSensorRaw;
|
|
1393
|
+
})();
|
|
1394
|
+
|
|
1395
|
+
var BthomeSensorDewpoint001 = BthomeServiceData.BthomeSensorDewpoint001 = (function() {
|
|
1396
|
+
function BthomeSensorDewpoint001(_io, _parent, _root) {
|
|
1397
|
+
this._io = _io;
|
|
1398
|
+
this._parent = _parent;
|
|
1399
|
+
this._root = _root || this;
|
|
1400
|
+
|
|
1401
|
+
this._read();
|
|
1402
|
+
}
|
|
1403
|
+
BthomeSensorDewpoint001.prototype._read = function() {
|
|
1404
|
+
this.value = this._io.readS2le();
|
|
1405
|
+
}
|
|
1406
|
+
Object.defineProperty(BthomeSensorDewpoint001.prototype, 'dewPoint', {
|
|
1407
|
+
get: function() {
|
|
1408
|
+
if (this._m_dewPoint !== undefined)
|
|
1409
|
+
return this._m_dewPoint;
|
|
1410
|
+
this._m_dewPoint = (this.value * 0.01);
|
|
1411
|
+
return this._m_dewPoint;
|
|
1412
|
+
}
|
|
1413
|
+
});
|
|
1414
|
+
Object.defineProperty(BthomeSensorDewpoint001.prototype, 'unit', {
|
|
1415
|
+
get: function() {
|
|
1416
|
+
if (this._m_unit !== undefined)
|
|
1417
|
+
return this._m_unit;
|
|
1418
|
+
this._m_unit = "\xb0C";
|
|
1419
|
+
return this._m_unit;
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1422
|
+
|
|
1423
|
+
return BthomeSensorDewpoint001;
|
|
1424
|
+
})();
|
|
1425
|
+
|
|
1426
|
+
var BthomeBinaryOccupancy = BthomeServiceData.BthomeBinaryOccupancy = (function() {
|
|
1427
|
+
function BthomeBinaryOccupancy(_io, _parent, _root) {
|
|
1428
|
+
this._io = _io;
|
|
1429
|
+
this._parent = _parent;
|
|
1430
|
+
this._root = _root || this;
|
|
1431
|
+
|
|
1432
|
+
this._read();
|
|
1433
|
+
}
|
|
1434
|
+
BthomeBinaryOccupancy.prototype._read = function() {
|
|
1435
|
+
this.occupancy = new Bool8(this._io, this, this._root);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
return BthomeBinaryOccupancy;
|
|
1439
|
+
})();
|
|
1440
|
+
|
|
1441
|
+
var BthomeSensorCount = BthomeServiceData.BthomeSensorCount = (function() {
|
|
1442
|
+
function BthomeSensorCount(_io, _parent, _root) {
|
|
1443
|
+
this._io = _io;
|
|
1444
|
+
this._parent = _parent;
|
|
1445
|
+
this._root = _root || this;
|
|
1446
|
+
|
|
1447
|
+
this._read();
|
|
1448
|
+
}
|
|
1449
|
+
BthomeSensorCount.prototype._read = function() {
|
|
1450
|
+
this.count = this._io.readU1();
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
return BthomeSensorCount;
|
|
1454
|
+
})();
|
|
1455
|
+
|
|
1456
|
+
var BthomeMeasurement = BthomeServiceData.BthomeMeasurement = (function() {
|
|
1457
|
+
function BthomeMeasurement(_io, _parent, _root) {
|
|
1458
|
+
this._io = _io;
|
|
1459
|
+
this._parent = _parent;
|
|
1460
|
+
this._root = _root || this;
|
|
1461
|
+
|
|
1462
|
+
this._read();
|
|
1463
|
+
}
|
|
1464
|
+
BthomeMeasurement.prototype._read = function() {
|
|
1465
|
+
this.objectId = this._io.readU1();
|
|
1466
|
+
switch (this.objectId) {
|
|
1467
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_MASS_LB_0_01:
|
|
1468
|
+
this.data = new BthomeSensorMassLb001(this._io, this, this._root);
|
|
1469
|
+
break;
|
|
1470
|
+
case BthomeServiceData.BthomeObjectId.BINARY_MOVING:
|
|
1471
|
+
this.data = new BthomeBinaryMoving(this._io, this, this._root);
|
|
1472
|
+
break;
|
|
1473
|
+
case BthomeServiceData.BthomeObjectId.BINARY_MOISTURE:
|
|
1474
|
+
this.data = new BthomeBinaryMoisture(this._io, this, this._root);
|
|
1475
|
+
break;
|
|
1476
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_HUMIDITY_0_01:
|
|
1477
|
+
this.data = new BthomeSensorHumidity001(this._io, this, this._root);
|
|
1478
|
+
break;
|
|
1479
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_DISTANCE_MM:
|
|
1480
|
+
this.data = new BthomeSensorDistanceMm(this._io, this, this._root);
|
|
1481
|
+
break;
|
|
1482
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_UV_INDEX_0_1:
|
|
1483
|
+
this.data = new BthomeSensorUvIndex01(this._io, this, this._root);
|
|
1484
|
+
break;
|
|
1485
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_MOISTURE_0_01:
|
|
1486
|
+
this.data = new BthomeSensorMoisture001(this._io, this, this._root);
|
|
1487
|
+
break;
|
|
1488
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_GAS:
|
|
1489
|
+
this.data = new BthomeSensorGas(this._io, this, this._root);
|
|
1490
|
+
break;
|
|
1491
|
+
case BthomeServiceData.BthomeObjectId.BINARY_MOTION:
|
|
1492
|
+
this.data = new BthomeBinaryMotion(this._io, this, this._root);
|
|
1493
|
+
break;
|
|
1494
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_ENERGY_0_001:
|
|
1495
|
+
this.data = new BthomeSensorEnergy0001(this._io, this, this._root);
|
|
1496
|
+
break;
|
|
1497
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_TEMPERATURE_0_01:
|
|
1498
|
+
this.data = new BthomeSensorTemperature001(this._io, this, this._root);
|
|
1499
|
+
break;
|
|
1500
|
+
case BthomeServiceData.BthomeObjectId.BINARY_OPENING:
|
|
1501
|
+
this.data = new BthomeBinaryOpening(this._io, this, this._root);
|
|
1502
|
+
break;
|
|
1503
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_DEWPOINT_0_01:
|
|
1504
|
+
this.data = new BthomeSensorDewpoint001(this._io, this, this._root);
|
|
1505
|
+
break;
|
|
1506
|
+
case BthomeServiceData.BthomeObjectId.BINARY_SMOKE:
|
|
1507
|
+
this.data = new BthomeBinarySmoke(this._io, this, this._root);
|
|
1508
|
+
break;
|
|
1509
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_VOLUME_STORAGE:
|
|
1510
|
+
this.data = new BthomeSensorVolumeStorage(this._io, this, this._root);
|
|
1511
|
+
break;
|
|
1512
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_CO2:
|
|
1513
|
+
this.data = new BthomeSensorCo2(this._io, this, this._root);
|
|
1514
|
+
break;
|
|
1515
|
+
case BthomeServiceData.BthomeObjectId.BINARY_SOUND:
|
|
1516
|
+
this.data = new BthomeBinarySound(this._io, this, this._root);
|
|
1517
|
+
break;
|
|
1518
|
+
case BthomeServiceData.BthomeObjectId.MISC_PACKET_ID:
|
|
1519
|
+
this.data = new BthomeMiscPacketId(this._io, this, this._root);
|
|
1520
|
+
break;
|
|
1521
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_VOLUME_FLOW_RATE_0_001:
|
|
1522
|
+
this.data = new BthomeSensorVolumeFlowRate0001(this._io, this, this._root);
|
|
1523
|
+
break;
|
|
1524
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_VOLUME_0_001:
|
|
1525
|
+
this.data = new BthomeSensorVolume0001(this._io, this, this._root);
|
|
1526
|
+
break;
|
|
1527
|
+
case BthomeServiceData.BthomeObjectId.BINARY_OCCUPANCY:
|
|
1528
|
+
this.data = new BthomeBinaryOccupancy(this._io, this, this._root);
|
|
1529
|
+
break;
|
|
1530
|
+
case BthomeServiceData.BthomeObjectId.BINARY_DOOR:
|
|
1531
|
+
this.data = new BthomeBinaryDoor(this._io, this, this._root);
|
|
1532
|
+
break;
|
|
1533
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_VOLUME:
|
|
1534
|
+
this.data = new BthomeSensorVolume(this._io, this, this._root);
|
|
1535
|
+
break;
|
|
1536
|
+
case BthomeServiceData.BthomeObjectId.BINARY_GENERIC_BOOLEAN:
|
|
1537
|
+
this.data = new BthomeBinaryGenericBoolean(this._io, this, this._root);
|
|
1538
|
+
break;
|
|
1539
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_POWER_0_01:
|
|
1540
|
+
this.data = new BthomeSensorPower001(this._io, this, this._root);
|
|
1541
|
+
break;
|
|
1542
|
+
case BthomeServiceData.BthomeObjectId.BINARY_LIGHT:
|
|
1543
|
+
this.data = new BthomeBinaryLight(this._io, this, this._root);
|
|
1544
|
+
break;
|
|
1545
|
+
case BthomeServiceData.BthomeObjectId.BINARY_WINDOW:
|
|
1546
|
+
this.data = new BthomeBinaryWindow(this._io, this, this._root);
|
|
1547
|
+
break;
|
|
1548
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_COUNT_UINT32:
|
|
1549
|
+
this.data = new BthomeSensorCountUint32(this._io, this, this._root);
|
|
1550
|
+
break;
|
|
1551
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_CURRENT_0_001:
|
|
1552
|
+
this.data = new BthomeSensorCurrent0001(this._io, this, this._root);
|
|
1553
|
+
break;
|
|
1554
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_MASS_KG_0_01:
|
|
1555
|
+
this.data = new BthomeSensorMassKg001(this._io, this, this._root);
|
|
1556
|
+
break;
|
|
1557
|
+
case BthomeServiceData.BthomeObjectId.BINARY_PRESENCE:
|
|
1558
|
+
this.data = new BthomeBinaryPresence(this._io, this, this._root);
|
|
1559
|
+
break;
|
|
1560
|
+
case BthomeServiceData.BthomeObjectId.BINARY_GAS:
|
|
1561
|
+
this.data = new BthomeBinaryGas(this._io, this, this._root);
|
|
1562
|
+
break;
|
|
1563
|
+
case BthomeServiceData.BthomeObjectId.BINARY_GARAGE_DOOR:
|
|
1564
|
+
this.data = new BthomeBinaryGarageDoor(this._io, this, this._root);
|
|
1565
|
+
break;
|
|
1566
|
+
case BthomeServiceData.BthomeObjectId.BINARY_CONNECTIVITY:
|
|
1567
|
+
this.data = new BthomeBinaryConnectivity(this._io, this, this._root);
|
|
1568
|
+
break;
|
|
1569
|
+
case BthomeServiceData.BthomeObjectId.BINARY_PROBLEM:
|
|
1570
|
+
this.data = new BthomeBinaryProblem(this._io, this, this._root);
|
|
1571
|
+
break;
|
|
1572
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_RAW:
|
|
1573
|
+
this.data = new BthomeSensorRaw(this._io, this, this._root);
|
|
1574
|
+
break;
|
|
1575
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_DISTANCE_M_0_1:
|
|
1576
|
+
this.data = new BthomeSensorDistanceM01(this._io, this, this._root);
|
|
1577
|
+
break;
|
|
1578
|
+
case BthomeServiceData.BthomeObjectId.BINARY_RUNNING:
|
|
1579
|
+
this.data = new BthomeBinaryRunning(this._io, this, this._root);
|
|
1580
|
+
break;
|
|
1581
|
+
case BthomeServiceData.BthomeObjectId.EVENT_BUTTON:
|
|
1582
|
+
this.data = new BthomeEventButton(this._io, this, this._root);
|
|
1583
|
+
break;
|
|
1584
|
+
case BthomeServiceData.BthomeObjectId.BINARY_TAMPER:
|
|
1585
|
+
this.data = new BthomeBinaryTamper(this._io, this, this._root);
|
|
1586
|
+
break;
|
|
1587
|
+
case BthomeServiceData.BthomeObjectId.DEVICE_FW_VERSION_UINT32:
|
|
1588
|
+
this.data = new BthomeDeviceFwVersionUint32(this._io, this, this._root);
|
|
1589
|
+
break;
|
|
1590
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_VOLTAGE_0_001:
|
|
1591
|
+
this.data = new BthomeSensorVoltage0001(this._io, this, this._root);
|
|
1592
|
+
break;
|
|
1593
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_TIMESTAMP:
|
|
1594
|
+
this.data = new BthomeSensorTimestamp(this._io, this, this._root);
|
|
1595
|
+
break;
|
|
1596
|
+
case BthomeServiceData.BthomeObjectId.BINARY_PLUG:
|
|
1597
|
+
this.data = new BthomeBinaryPlug(this._io, this, this._root);
|
|
1598
|
+
break;
|
|
1599
|
+
case BthomeServiceData.BthomeObjectId.BINARY_BATTERY_CHARGING:
|
|
1600
|
+
this.data = new BthomeBinaryBatteryCharging(this._io, this, this._root);
|
|
1601
|
+
break;
|
|
1602
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_TVOC:
|
|
1603
|
+
this.data = new BthomeSensorTvoc(this._io, this, this._root);
|
|
1604
|
+
break;
|
|
1605
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_DURATION_0_001:
|
|
1606
|
+
this.data = new BthomeSensorDuration0001(this._io, this, this._root);
|
|
1607
|
+
break;
|
|
1608
|
+
case BthomeServiceData.BthomeObjectId.BINARY_LOCK:
|
|
1609
|
+
this.data = new BthomeBinaryLock(this._io, this, this._root);
|
|
1610
|
+
break;
|
|
1611
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_BATTERY:
|
|
1612
|
+
this.data = new BthomeSensorBattery(this._io, this, this._root);
|
|
1613
|
+
break;
|
|
1614
|
+
case BthomeServiceData.BthomeObjectId.BINARY_COLD:
|
|
1615
|
+
this.data = new BthomeBinaryCold(this._io, this, this._root);
|
|
1616
|
+
break;
|
|
1617
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_PRESSURE_0_01:
|
|
1618
|
+
this.data = new BthomeSensorPressure001(this._io, this, this._root);
|
|
1619
|
+
break;
|
|
1620
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_VOLUME_0_1:
|
|
1621
|
+
this.data = new BthomeSensorVolume01(this._io, this, this._root);
|
|
1622
|
+
break;
|
|
1623
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_VOLTAGE_0_1:
|
|
1624
|
+
this.data = new BthomeSensorVoltage01(this._io, this, this._root);
|
|
1625
|
+
break;
|
|
1626
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_ILLUMINANCE_0_01:
|
|
1627
|
+
this.data = new BthomeSensorIlluminance001(this._io, this, this._root);
|
|
1628
|
+
break;
|
|
1629
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_ACCELERATION:
|
|
1630
|
+
this.data = new BthomeSensorAcceleration(this._io, this, this._root);
|
|
1631
|
+
break;
|
|
1632
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_TEMPERATURE_0_1:
|
|
1633
|
+
this.data = new BthomeSensorTemperature01(this._io, this, this._root);
|
|
1634
|
+
break;
|
|
1635
|
+
case BthomeServiceData.BthomeObjectId.DEVICE_TYPE:
|
|
1636
|
+
this.data = new BthomeDeviceType(this._io, this, this._root);
|
|
1637
|
+
break;
|
|
1638
|
+
case BthomeServiceData.BthomeObjectId.DEVICE_FW_VERSION_UINT24:
|
|
1639
|
+
this.data = new BthomeDeviceFwVersionUint24(this._io, this, this._root);
|
|
1640
|
+
break;
|
|
1641
|
+
case BthomeServiceData.BthomeObjectId.BINARY_BATTERY:
|
|
1642
|
+
this.data = new BthomeBinaryBattery(this._io, this, this._root);
|
|
1643
|
+
break;
|
|
1644
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_COUNT_UINT16:
|
|
1645
|
+
this.data = new BthomeSensorCountUint16(this._io, this, this._root);
|
|
1646
|
+
break;
|
|
1647
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_GAS_UINT32:
|
|
1648
|
+
this.data = new BthomeSensorGasUint32(this._io, this, this._root);
|
|
1649
|
+
break;
|
|
1650
|
+
case BthomeServiceData.BthomeObjectId.BINARY_POWER:
|
|
1651
|
+
this.data = new BthomeBinaryPower(this._io, this, this._root);
|
|
1652
|
+
break;
|
|
1653
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_COUNT:
|
|
1654
|
+
this.data = new BthomeSensorCount(this._io, this, this._root);
|
|
1655
|
+
break;
|
|
1656
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_WATER:
|
|
1657
|
+
this.data = new BthomeSensorWater(this._io, this, this._root);
|
|
1658
|
+
break;
|
|
1659
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_HUMIDITY:
|
|
1660
|
+
this.data = new BthomeSensorHumidity(this._io, this, this._root);
|
|
1661
|
+
break;
|
|
1662
|
+
case BthomeServiceData.BthomeObjectId.BINARY_CARBON_MONOXIDE:
|
|
1663
|
+
this.data = new BthomeBinaryCarbonMonoxide(this._io, this, this._root);
|
|
1664
|
+
break;
|
|
1665
|
+
case BthomeServiceData.BthomeObjectId.BINARY_HEAT:
|
|
1666
|
+
this.data = new BthomeBinaryHeat(this._io, this, this._root);
|
|
1667
|
+
break;
|
|
1668
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_PM10:
|
|
1669
|
+
this.data = new BthomeSensorPm10(this._io, this, this._root);
|
|
1670
|
+
break;
|
|
1671
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_ROTATION_0_1:
|
|
1672
|
+
this.data = new BthomeSensorRotation01(this._io, this, this._root);
|
|
1673
|
+
break;
|
|
1674
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_SPEED_0_01:
|
|
1675
|
+
this.data = new BthomeSensorSpeed001(this._io, this, this._root);
|
|
1676
|
+
break;
|
|
1677
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_TEXT:
|
|
1678
|
+
this.data = new BthomeSensorText(this._io, this, this._root);
|
|
1679
|
+
break;
|
|
1680
|
+
case BthomeServiceData.BthomeObjectId.EVENT_DIMMER:
|
|
1681
|
+
this.data = new BthomeEventDimmer(this._io, this, this._root);
|
|
1682
|
+
break;
|
|
1683
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_GYROSCOPE:
|
|
1684
|
+
this.data = new BthomeSensorGyroscope(this._io, this, this._root);
|
|
1685
|
+
break;
|
|
1686
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_ENERGY_0_001_UINT32:
|
|
1687
|
+
this.data = new BthomeSensorEnergy0001Uint32(this._io, this, this._root);
|
|
1688
|
+
break;
|
|
1689
|
+
case BthomeServiceData.BthomeObjectId.BINARY_SAFETY:
|
|
1690
|
+
this.data = new BthomeBinarySafety(this._io, this, this._root);
|
|
1691
|
+
break;
|
|
1692
|
+
case BthomeServiceData.BthomeObjectId.BINARY_VIBRATION:
|
|
1693
|
+
this.data = new BthomeBinaryVibration(this._io, this, this._root);
|
|
1694
|
+
break;
|
|
1695
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_PM2_5:
|
|
1696
|
+
this.data = new BthomeSensorPm25(this._io, this, this._root);
|
|
1697
|
+
break;
|
|
1698
|
+
case BthomeServiceData.BthomeObjectId.SENSOR_MOISTURE:
|
|
1699
|
+
this.data = new BthomeSensorMoisture(this._io, this, this._root);
|
|
1700
|
+
break;
|
|
1701
|
+
default:
|
|
1702
|
+
this.data = new BthomeUnknown(this._io, this, this._root);
|
|
1703
|
+
break;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
return BthomeMeasurement;
|
|
1708
|
+
})();
|
|
1709
|
+
|
|
1710
|
+
var BthomeSensorMoisture = BthomeServiceData.BthomeSensorMoisture = (function() {
|
|
1711
|
+
function BthomeSensorMoisture(_io, _parent, _root) {
|
|
1712
|
+
this._io = _io;
|
|
1713
|
+
this._parent = _parent;
|
|
1714
|
+
this._root = _root || this;
|
|
1715
|
+
|
|
1716
|
+
this._read();
|
|
1717
|
+
}
|
|
1718
|
+
BthomeSensorMoisture.prototype._read = function() {
|
|
1719
|
+
this.moisture = this._io.readU1();
|
|
1720
|
+
}
|
|
1721
|
+
Object.defineProperty(BthomeSensorMoisture.prototype, 'unit', {
|
|
1722
|
+
get: function() {
|
|
1723
|
+
if (this._m_unit !== undefined)
|
|
1724
|
+
return this._m_unit;
|
|
1725
|
+
this._m_unit = "%";
|
|
1726
|
+
return this._m_unit;
|
|
1727
|
+
}
|
|
1728
|
+
});
|
|
1729
|
+
|
|
1730
|
+
return BthomeSensorMoisture;
|
|
1731
|
+
})();
|
|
1732
|
+
|
|
1733
|
+
var BthomeBinaryRunning = BthomeServiceData.BthomeBinaryRunning = (function() {
|
|
1734
|
+
function BthomeBinaryRunning(_io, _parent, _root) {
|
|
1735
|
+
this._io = _io;
|
|
1736
|
+
this._parent = _parent;
|
|
1737
|
+
this._root = _root || this;
|
|
1738
|
+
|
|
1739
|
+
this._read();
|
|
1740
|
+
}
|
|
1741
|
+
BthomeBinaryRunning.prototype._read = function() {
|
|
1742
|
+
this.running = new Bool8(this._io, this, this._root);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
return BthomeBinaryRunning;
|
|
1746
|
+
})();
|
|
1747
|
+
|
|
1748
|
+
var BthomeBinaryPlug = BthomeServiceData.BthomeBinaryPlug = (function() {
|
|
1749
|
+
function BthomeBinaryPlug(_io, _parent, _root) {
|
|
1750
|
+
this._io = _io;
|
|
1751
|
+
this._parent = _parent;
|
|
1752
|
+
this._root = _root || this;
|
|
1753
|
+
|
|
1754
|
+
this._read();
|
|
1755
|
+
}
|
|
1756
|
+
BthomeBinaryPlug.prototype._read = function() {
|
|
1757
|
+
this.plug = new Bool8(this._io, this, this._root);
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
return BthomeBinaryPlug;
|
|
1761
|
+
})();
|
|
1762
|
+
|
|
1763
|
+
var BthomeSensorPower001 = BthomeServiceData.BthomeSensorPower001 = (function() {
|
|
1764
|
+
function BthomeSensorPower001(_io, _parent, _root) {
|
|
1765
|
+
this._io = _io;
|
|
1766
|
+
this._parent = _parent;
|
|
1767
|
+
this._root = _root || this;
|
|
1768
|
+
|
|
1769
|
+
this._read();
|
|
1770
|
+
}
|
|
1771
|
+
BthomeSensorPower001.prototype._read = function() {
|
|
1772
|
+
this.value = new U3(this._io, this, this._root);
|
|
1773
|
+
}
|
|
1774
|
+
Object.defineProperty(BthomeSensorPower001.prototype, 'power', {
|
|
1775
|
+
get: function() {
|
|
1776
|
+
if (this._m_power !== undefined)
|
|
1777
|
+
return this._m_power;
|
|
1778
|
+
this._m_power = (this.value.value * 0.01);
|
|
1779
|
+
return this._m_power;
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
Object.defineProperty(BthomeSensorPower001.prototype, 'unit', {
|
|
1783
|
+
get: function() {
|
|
1784
|
+
if (this._m_unit !== undefined)
|
|
1785
|
+
return this._m_unit;
|
|
1786
|
+
this._m_unit = "W";
|
|
1787
|
+
return this._m_unit;
|
|
1788
|
+
}
|
|
1789
|
+
});
|
|
1790
|
+
|
|
1791
|
+
return BthomeSensorPower001;
|
|
1792
|
+
})();
|
|
1793
|
+
|
|
1794
|
+
var BthomeBinaryMotion = BthomeServiceData.BthomeBinaryMotion = (function() {
|
|
1795
|
+
function BthomeBinaryMotion(_io, _parent, _root) {
|
|
1796
|
+
this._io = _io;
|
|
1797
|
+
this._parent = _parent;
|
|
1798
|
+
this._root = _root || this;
|
|
1799
|
+
|
|
1800
|
+
this._read();
|
|
1801
|
+
}
|
|
1802
|
+
BthomeBinaryMotion.prototype._read = function() {
|
|
1803
|
+
this.motion = new Bool8(this._io, this, this._root);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
return BthomeBinaryMotion;
|
|
1807
|
+
})();
|
|
1808
|
+
|
|
1809
|
+
var BthomeBinaryTamper = BthomeServiceData.BthomeBinaryTamper = (function() {
|
|
1810
|
+
function BthomeBinaryTamper(_io, _parent, _root) {
|
|
1811
|
+
this._io = _io;
|
|
1812
|
+
this._parent = _parent;
|
|
1813
|
+
this._root = _root || this;
|
|
1814
|
+
|
|
1815
|
+
this._read();
|
|
1816
|
+
}
|
|
1817
|
+
BthomeBinaryTamper.prototype._read = function() {
|
|
1818
|
+
this.tamper = new Bool8(this._io, this, this._root);
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
return BthomeBinaryTamper;
|
|
1822
|
+
})();
|
|
1823
|
+
|
|
1824
|
+
var BthomeBinaryBatteryCharging = BthomeServiceData.BthomeBinaryBatteryCharging = (function() {
|
|
1825
|
+
function BthomeBinaryBatteryCharging(_io, _parent, _root) {
|
|
1826
|
+
this._io = _io;
|
|
1827
|
+
this._parent = _parent;
|
|
1828
|
+
this._root = _root || this;
|
|
1829
|
+
|
|
1830
|
+
this._read();
|
|
1831
|
+
}
|
|
1832
|
+
BthomeBinaryBatteryCharging.prototype._read = function() {
|
|
1833
|
+
this.batteryCharging = new Bool8(this._io, this, this._root);
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
return BthomeBinaryBatteryCharging;
|
|
1837
|
+
})();
|
|
1838
|
+
|
|
1839
|
+
var BthomeSensorVolume0001 = BthomeServiceData.BthomeSensorVolume0001 = (function() {
|
|
1840
|
+
function BthomeSensorVolume0001(_io, _parent, _root) {
|
|
1841
|
+
this._io = _io;
|
|
1842
|
+
this._parent = _parent;
|
|
1843
|
+
this._root = _root || this;
|
|
1844
|
+
|
|
1845
|
+
this._read();
|
|
1846
|
+
}
|
|
1847
|
+
BthomeSensorVolume0001.prototype._read = function() {
|
|
1848
|
+
this.value = this._io.readU4le();
|
|
1849
|
+
}
|
|
1850
|
+
Object.defineProperty(BthomeSensorVolume0001.prototype, 'volume', {
|
|
1851
|
+
get: function() {
|
|
1852
|
+
if (this._m_volume !== undefined)
|
|
1853
|
+
return this._m_volume;
|
|
1854
|
+
this._m_volume = (this.value * 0.001);
|
|
1855
|
+
return this._m_volume;
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
Object.defineProperty(BthomeSensorVolume0001.prototype, 'unit', {
|
|
1859
|
+
get: function() {
|
|
1860
|
+
if (this._m_unit !== undefined)
|
|
1861
|
+
return this._m_unit;
|
|
1862
|
+
this._m_unit = "L";
|
|
1863
|
+
return this._m_unit;
|
|
1864
|
+
}
|
|
1865
|
+
});
|
|
1866
|
+
|
|
1867
|
+
return BthomeSensorVolume0001;
|
|
1868
|
+
})();
|
|
1869
|
+
|
|
1870
|
+
var BthomeSensorDistanceM01 = BthomeServiceData.BthomeSensorDistanceM01 = (function() {
|
|
1871
|
+
function BthomeSensorDistanceM01(_io, _parent, _root) {
|
|
1872
|
+
this._io = _io;
|
|
1873
|
+
this._parent = _parent;
|
|
1874
|
+
this._root = _root || this;
|
|
1875
|
+
|
|
1876
|
+
this._read();
|
|
1877
|
+
}
|
|
1878
|
+
BthomeSensorDistanceM01.prototype._read = function() {
|
|
1879
|
+
this.value = this._io.readS2le();
|
|
1880
|
+
}
|
|
1881
|
+
Object.defineProperty(BthomeSensorDistanceM01.prototype, 'distance', {
|
|
1882
|
+
get: function() {
|
|
1883
|
+
if (this._m_distance !== undefined)
|
|
1884
|
+
return this._m_distance;
|
|
1885
|
+
this._m_distance = (this.value * 0.1);
|
|
1886
|
+
return this._m_distance;
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
Object.defineProperty(BthomeSensorDistanceM01.prototype, 'unit', {
|
|
1890
|
+
get: function() {
|
|
1891
|
+
if (this._m_unit !== undefined)
|
|
1892
|
+
return this._m_unit;
|
|
1893
|
+
this._m_unit = "m";
|
|
1894
|
+
return this._m_unit;
|
|
1895
|
+
}
|
|
1896
|
+
});
|
|
1897
|
+
|
|
1898
|
+
return BthomeSensorDistanceM01;
|
|
1899
|
+
})();
|
|
1900
|
+
|
|
1901
|
+
var BthomeSensorHumidity = BthomeServiceData.BthomeSensorHumidity = (function() {
|
|
1902
|
+
function BthomeSensorHumidity(_io, _parent, _root) {
|
|
1903
|
+
this._io = _io;
|
|
1904
|
+
this._parent = _parent;
|
|
1905
|
+
this._root = _root || this;
|
|
1906
|
+
|
|
1907
|
+
this._read();
|
|
1908
|
+
}
|
|
1909
|
+
BthomeSensorHumidity.prototype._read = function() {
|
|
1910
|
+
this.humidity = this._io.readU1();
|
|
1911
|
+
}
|
|
1912
|
+
Object.defineProperty(BthomeSensorHumidity.prototype, 'unit', {
|
|
1913
|
+
get: function() {
|
|
1914
|
+
if (this._m_unit !== undefined)
|
|
1915
|
+
return this._m_unit;
|
|
1916
|
+
this._m_unit = "%";
|
|
1917
|
+
return this._m_unit;
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1920
|
+
|
|
1921
|
+
return BthomeSensorHumidity;
|
|
1922
|
+
})();
|
|
1923
|
+
|
|
1924
|
+
var BthomeBinaryCarbonMonoxide = BthomeServiceData.BthomeBinaryCarbonMonoxide = (function() {
|
|
1925
|
+
function BthomeBinaryCarbonMonoxide(_io, _parent, _root) {
|
|
1926
|
+
this._io = _io;
|
|
1927
|
+
this._parent = _parent;
|
|
1928
|
+
this._root = _root || this;
|
|
1929
|
+
|
|
1930
|
+
this._read();
|
|
1931
|
+
}
|
|
1932
|
+
BthomeBinaryCarbonMonoxide.prototype._read = function() {
|
|
1933
|
+
this.carbonMonoxide = new Bool8(this._io, this, this._root);
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
return BthomeBinaryCarbonMonoxide;
|
|
1937
|
+
})();
|
|
1938
|
+
|
|
1939
|
+
var BthomeSensorText = BthomeServiceData.BthomeSensorText = (function() {
|
|
1940
|
+
function BthomeSensorText(_io, _parent, _root) {
|
|
1941
|
+
this._io = _io;
|
|
1942
|
+
this._parent = _parent;
|
|
1943
|
+
this._root = _root || this;
|
|
1944
|
+
|
|
1945
|
+
this._read();
|
|
1946
|
+
}
|
|
1947
|
+
BthomeSensorText.prototype._read = function() {
|
|
1948
|
+
this.lenValue = this._io.readU1();
|
|
1949
|
+
this.value = KaitaiStream.bytesToStr(this._io.readBytes(this.lenValue), "UTF-8");
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
return BthomeSensorText;
|
|
1953
|
+
})();
|
|
1954
|
+
|
|
1955
|
+
var BthomeBinaryLight = BthomeServiceData.BthomeBinaryLight = (function() {
|
|
1956
|
+
function BthomeBinaryLight(_io, _parent, _root) {
|
|
1957
|
+
this._io = _io;
|
|
1958
|
+
this._parent = _parent;
|
|
1959
|
+
this._root = _root || this;
|
|
1960
|
+
|
|
1961
|
+
this._read();
|
|
1962
|
+
}
|
|
1963
|
+
BthomeBinaryLight.prototype._read = function() {
|
|
1964
|
+
this.light = new Bool8(this._io, this, this._root);
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
return BthomeBinaryLight;
|
|
1968
|
+
})();
|
|
1969
|
+
|
|
1970
|
+
var BthomeBinarySafety = BthomeServiceData.BthomeBinarySafety = (function() {
|
|
1971
|
+
function BthomeBinarySafety(_io, _parent, _root) {
|
|
1972
|
+
this._io = _io;
|
|
1973
|
+
this._parent = _parent;
|
|
1974
|
+
this._root = _root || this;
|
|
1975
|
+
|
|
1976
|
+
this._read();
|
|
1977
|
+
}
|
|
1978
|
+
BthomeBinarySafety.prototype._read = function() {
|
|
1979
|
+
this.safety = new Bool8(this._io, this, this._root);
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
return BthomeBinarySafety;
|
|
1983
|
+
})();
|
|
1984
|
+
|
|
1985
|
+
var BthomeSensorHumidity001 = BthomeServiceData.BthomeSensorHumidity001 = (function() {
|
|
1986
|
+
function BthomeSensorHumidity001(_io, _parent, _root) {
|
|
1987
|
+
this._io = _io;
|
|
1988
|
+
this._parent = _parent;
|
|
1989
|
+
this._root = _root || this;
|
|
1990
|
+
|
|
1991
|
+
this._read();
|
|
1992
|
+
}
|
|
1993
|
+
BthomeSensorHumidity001.prototype._read = function() {
|
|
1994
|
+
this.value = this._io.readU2le();
|
|
1995
|
+
}
|
|
1996
|
+
Object.defineProperty(BthomeSensorHumidity001.prototype, 'humidity', {
|
|
1997
|
+
get: function() {
|
|
1998
|
+
if (this._m_humidity !== undefined)
|
|
1999
|
+
return this._m_humidity;
|
|
2000
|
+
this._m_humidity = (this.value * 0.01);
|
|
2001
|
+
return this._m_humidity;
|
|
2002
|
+
}
|
|
2003
|
+
});
|
|
2004
|
+
Object.defineProperty(BthomeSensorHumidity001.prototype, 'unit', {
|
|
2005
|
+
get: function() {
|
|
2006
|
+
if (this._m_unit !== undefined)
|
|
2007
|
+
return this._m_unit;
|
|
2008
|
+
this._m_unit = "%";
|
|
2009
|
+
return this._m_unit;
|
|
2010
|
+
}
|
|
2011
|
+
});
|
|
2012
|
+
|
|
2013
|
+
return BthomeSensorHumidity001;
|
|
2014
|
+
})();
|
|
2015
|
+
|
|
2016
|
+
var BthomeSensorMoisture001 = BthomeServiceData.BthomeSensorMoisture001 = (function() {
|
|
2017
|
+
function BthomeSensorMoisture001(_io, _parent, _root) {
|
|
2018
|
+
this._io = _io;
|
|
2019
|
+
this._parent = _parent;
|
|
2020
|
+
this._root = _root || this;
|
|
2021
|
+
|
|
2022
|
+
this._read();
|
|
2023
|
+
}
|
|
2024
|
+
BthomeSensorMoisture001.prototype._read = function() {
|
|
2025
|
+
this.value = this._io.readU2le();
|
|
2026
|
+
}
|
|
2027
|
+
Object.defineProperty(BthomeSensorMoisture001.prototype, 'moisture', {
|
|
2028
|
+
get: function() {
|
|
2029
|
+
if (this._m_moisture !== undefined)
|
|
2030
|
+
return this._m_moisture;
|
|
2031
|
+
this._m_moisture = (this.value * 0.01);
|
|
2032
|
+
return this._m_moisture;
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
Object.defineProperty(BthomeSensorMoisture001.prototype, 'unit', {
|
|
2036
|
+
get: function() {
|
|
2037
|
+
if (this._m_unit !== undefined)
|
|
2038
|
+
return this._m_unit;
|
|
2039
|
+
this._m_unit = "%";
|
|
2040
|
+
return this._m_unit;
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
2043
|
+
|
|
2044
|
+
return BthomeSensorMoisture001;
|
|
2045
|
+
})();
|
|
2046
|
+
|
|
2047
|
+
var BthomeSensorVolumeFlowRate0001 = BthomeServiceData.BthomeSensorVolumeFlowRate0001 = (function() {
|
|
2048
|
+
function BthomeSensorVolumeFlowRate0001(_io, _parent, _root) {
|
|
2049
|
+
this._io = _io;
|
|
2050
|
+
this._parent = _parent;
|
|
2051
|
+
this._root = _root || this;
|
|
2052
|
+
|
|
2053
|
+
this._read();
|
|
2054
|
+
}
|
|
2055
|
+
BthomeSensorVolumeFlowRate0001.prototype._read = function() {
|
|
2056
|
+
this.value = this._io.readU2le();
|
|
2057
|
+
}
|
|
2058
|
+
Object.defineProperty(BthomeSensorVolumeFlowRate0001.prototype, 'volumeFlowRate', {
|
|
2059
|
+
get: function() {
|
|
2060
|
+
if (this._m_volumeFlowRate !== undefined)
|
|
2061
|
+
return this._m_volumeFlowRate;
|
|
2062
|
+
this._m_volumeFlowRate = (this.value * 0.001);
|
|
2063
|
+
return this._m_volumeFlowRate;
|
|
2064
|
+
}
|
|
2065
|
+
});
|
|
2066
|
+
Object.defineProperty(BthomeSensorVolumeFlowRate0001.prototype, 'unit', {
|
|
2067
|
+
get: function() {
|
|
2068
|
+
if (this._m_unit !== undefined)
|
|
2069
|
+
return this._m_unit;
|
|
2070
|
+
this._m_unit = "m\xb3/hr";
|
|
2071
|
+
return this._m_unit;
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2074
|
+
|
|
2075
|
+
return BthomeSensorVolumeFlowRate0001;
|
|
2076
|
+
})();
|
|
2077
|
+
|
|
2078
|
+
var BthomeBinarySmoke = BthomeServiceData.BthomeBinarySmoke = (function() {
|
|
2079
|
+
function BthomeBinarySmoke(_io, _parent, _root) {
|
|
2080
|
+
this._io = _io;
|
|
2081
|
+
this._parent = _parent;
|
|
2082
|
+
this._root = _root || this;
|
|
2083
|
+
|
|
2084
|
+
this._read();
|
|
2085
|
+
}
|
|
2086
|
+
BthomeBinarySmoke.prototype._read = function() {
|
|
2087
|
+
this.smoke = new Bool8(this._io, this, this._root);
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
return BthomeBinarySmoke;
|
|
2091
|
+
})();
|
|
2092
|
+
|
|
2093
|
+
var BthomeSensorUvIndex01 = BthomeServiceData.BthomeSensorUvIndex01 = (function() {
|
|
2094
|
+
function BthomeSensorUvIndex01(_io, _parent, _root) {
|
|
2095
|
+
this._io = _io;
|
|
2096
|
+
this._parent = _parent;
|
|
2097
|
+
this._root = _root || this;
|
|
2098
|
+
|
|
2099
|
+
this._read();
|
|
2100
|
+
}
|
|
2101
|
+
BthomeSensorUvIndex01.prototype._read = function() {
|
|
2102
|
+
this.value = this._io.readU1();
|
|
2103
|
+
}
|
|
2104
|
+
Object.defineProperty(BthomeSensorUvIndex01.prototype, 'uvIndex', {
|
|
2105
|
+
get: function() {
|
|
2106
|
+
if (this._m_uvIndex !== undefined)
|
|
2107
|
+
return this._m_uvIndex;
|
|
2108
|
+
this._m_uvIndex = (this.value * 0.1);
|
|
2109
|
+
return this._m_uvIndex;
|
|
2110
|
+
}
|
|
2111
|
+
});
|
|
2112
|
+
|
|
2113
|
+
return BthomeSensorUvIndex01;
|
|
2114
|
+
})();
|
|
2115
|
+
|
|
2116
|
+
var BthomeBinaryProblem = BthomeServiceData.BthomeBinaryProblem = (function() {
|
|
2117
|
+
function BthomeBinaryProblem(_io, _parent, _root) {
|
|
2118
|
+
this._io = _io;
|
|
2119
|
+
this._parent = _parent;
|
|
2120
|
+
this._root = _root || this;
|
|
2121
|
+
|
|
2122
|
+
this._read();
|
|
2123
|
+
}
|
|
2124
|
+
BthomeBinaryProblem.prototype._read = function() {
|
|
2125
|
+
this.problem = new Bool8(this._io, this, this._root);
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
return BthomeBinaryProblem;
|
|
2129
|
+
})();
|
|
2130
|
+
|
|
2131
|
+
var BthomeSensorVoltage01 = BthomeServiceData.BthomeSensorVoltage01 = (function() {
|
|
2132
|
+
function BthomeSensorVoltage01(_io, _parent, _root) {
|
|
2133
|
+
this._io = _io;
|
|
2134
|
+
this._parent = _parent;
|
|
2135
|
+
this._root = _root || this;
|
|
2136
|
+
|
|
2137
|
+
this._read();
|
|
2138
|
+
}
|
|
2139
|
+
BthomeSensorVoltage01.prototype._read = function() {
|
|
2140
|
+
this.value = this._io.readU2le();
|
|
2141
|
+
}
|
|
2142
|
+
Object.defineProperty(BthomeSensorVoltage01.prototype, 'voltage', {
|
|
2143
|
+
get: function() {
|
|
2144
|
+
if (this._m_voltage !== undefined)
|
|
2145
|
+
return this._m_voltage;
|
|
2146
|
+
this._m_voltage = (this.value * 0.1);
|
|
2147
|
+
return this._m_voltage;
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
Object.defineProperty(BthomeSensorVoltage01.prototype, 'unit', {
|
|
2151
|
+
get: function() {
|
|
2152
|
+
if (this._m_unit !== undefined)
|
|
2153
|
+
return this._m_unit;
|
|
2154
|
+
this._m_unit = "V";
|
|
2155
|
+
return this._m_unit;
|
|
2156
|
+
}
|
|
2157
|
+
});
|
|
2158
|
+
|
|
2159
|
+
return BthomeSensorVoltage01;
|
|
2160
|
+
})();
|
|
2161
|
+
|
|
2162
|
+
var BthomeSensorRotation01 = BthomeServiceData.BthomeSensorRotation01 = (function() {
|
|
2163
|
+
function BthomeSensorRotation01(_io, _parent, _root) {
|
|
2164
|
+
this._io = _io;
|
|
2165
|
+
this._parent = _parent;
|
|
2166
|
+
this._root = _root || this;
|
|
2167
|
+
|
|
2168
|
+
this._read();
|
|
2169
|
+
}
|
|
2170
|
+
BthomeSensorRotation01.prototype._read = function() {
|
|
2171
|
+
this.value = this._io.readS2le();
|
|
2172
|
+
}
|
|
2173
|
+
Object.defineProperty(BthomeSensorRotation01.prototype, 'rotation', {
|
|
2174
|
+
get: function() {
|
|
2175
|
+
if (this._m_rotation !== undefined)
|
|
2176
|
+
return this._m_rotation;
|
|
2177
|
+
this._m_rotation = (this.value * 0.1);
|
|
2178
|
+
return this._m_rotation;
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
2181
|
+
Object.defineProperty(BthomeSensorRotation01.prototype, 'unit', {
|
|
2182
|
+
get: function() {
|
|
2183
|
+
if (this._m_unit !== undefined)
|
|
2184
|
+
return this._m_unit;
|
|
2185
|
+
this._m_unit = "\xb0";
|
|
2186
|
+
return this._m_unit;
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2189
|
+
|
|
2190
|
+
return BthomeSensorRotation01;
|
|
2191
|
+
})();
|
|
2192
|
+
|
|
2193
|
+
var BthomeBinaryGas = BthomeServiceData.BthomeBinaryGas = (function() {
|
|
2194
|
+
function BthomeBinaryGas(_io, _parent, _root) {
|
|
2195
|
+
this._io = _io;
|
|
2196
|
+
this._parent = _parent;
|
|
2197
|
+
this._root = _root || this;
|
|
2198
|
+
|
|
2199
|
+
this._read();
|
|
2200
|
+
}
|
|
2201
|
+
BthomeBinaryGas.prototype._read = function() {
|
|
2202
|
+
this.gas = new Bool8(this._io, this, this._root);
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
return BthomeBinaryGas;
|
|
2206
|
+
})();
|
|
2207
|
+
|
|
2208
|
+
var BthomeSensorGyroscope = BthomeServiceData.BthomeSensorGyroscope = (function() {
|
|
2209
|
+
function BthomeSensorGyroscope(_io, _parent, _root) {
|
|
2210
|
+
this._io = _io;
|
|
2211
|
+
this._parent = _parent;
|
|
2212
|
+
this._root = _root || this;
|
|
2213
|
+
|
|
2214
|
+
this._read();
|
|
2215
|
+
}
|
|
2216
|
+
BthomeSensorGyroscope.prototype._read = function() {
|
|
2217
|
+
this.value = this._io.readU2le();
|
|
2218
|
+
}
|
|
2219
|
+
Object.defineProperty(BthomeSensorGyroscope.prototype, 'gyroscope', {
|
|
2220
|
+
get: function() {
|
|
2221
|
+
if (this._m_gyroscope !== undefined)
|
|
2222
|
+
return this._m_gyroscope;
|
|
2223
|
+
this._m_gyroscope = (this.value * 0.001);
|
|
2224
|
+
return this._m_gyroscope;
|
|
2225
|
+
}
|
|
2226
|
+
});
|
|
2227
|
+
Object.defineProperty(BthomeSensorGyroscope.prototype, 'unit', {
|
|
2228
|
+
get: function() {
|
|
2229
|
+
if (this._m_unit !== undefined)
|
|
2230
|
+
return this._m_unit;
|
|
2231
|
+
this._m_unit = "\xb0/s";
|
|
2232
|
+
return this._m_unit;
|
|
2233
|
+
}
|
|
2234
|
+
});
|
|
2235
|
+
|
|
2236
|
+
return BthomeSensorGyroscope;
|
|
2237
|
+
})();
|
|
2238
|
+
|
|
2239
|
+
var BthomeSensorDuration0001 = BthomeServiceData.BthomeSensorDuration0001 = (function() {
|
|
2240
|
+
function BthomeSensorDuration0001(_io, _parent, _root) {
|
|
2241
|
+
this._io = _io;
|
|
2242
|
+
this._parent = _parent;
|
|
2243
|
+
this._root = _root || this;
|
|
2244
|
+
|
|
2245
|
+
this._read();
|
|
2246
|
+
}
|
|
2247
|
+
BthomeSensorDuration0001.prototype._read = function() {
|
|
2248
|
+
this.value = new U3(this._io, this, this._root);
|
|
2249
|
+
}
|
|
2250
|
+
Object.defineProperty(BthomeSensorDuration0001.prototype, 'duration', {
|
|
2251
|
+
get: function() {
|
|
2252
|
+
if (this._m_duration !== undefined)
|
|
2253
|
+
return this._m_duration;
|
|
2254
|
+
this._m_duration = (this.value.value * 0.001);
|
|
2255
|
+
return this._m_duration;
|
|
2256
|
+
}
|
|
2257
|
+
});
|
|
2258
|
+
Object.defineProperty(BthomeSensorDuration0001.prototype, 'unit', {
|
|
2259
|
+
get: function() {
|
|
2260
|
+
if (this._m_unit !== undefined)
|
|
2261
|
+
return this._m_unit;
|
|
2262
|
+
this._m_unit = "s";
|
|
2263
|
+
return this._m_unit;
|
|
2264
|
+
}
|
|
2265
|
+
});
|
|
2266
|
+
|
|
2267
|
+
return BthomeSensorDuration0001;
|
|
2268
|
+
})();
|
|
2269
|
+
|
|
2270
|
+
var BthomeBinaryGenericBoolean = BthomeServiceData.BthomeBinaryGenericBoolean = (function() {
|
|
2271
|
+
function BthomeBinaryGenericBoolean(_io, _parent, _root) {
|
|
2272
|
+
this._io = _io;
|
|
2273
|
+
this._parent = _parent;
|
|
2274
|
+
this._root = _root || this;
|
|
2275
|
+
|
|
2276
|
+
this._read();
|
|
2277
|
+
}
|
|
2278
|
+
BthomeBinaryGenericBoolean.prototype._read = function() {
|
|
2279
|
+
this.genericBoolean = new Bool8(this._io, this, this._root);
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
return BthomeBinaryGenericBoolean;
|
|
2283
|
+
})();
|
|
2284
|
+
|
|
2285
|
+
return BthomeServiceData;
|
|
2286
|
+
})();
|
|
2287
|
+
return BthomeServiceData;
|
|
2288
|
+
}));
|
|
2289
|
+
|