zigbee-herdsman-converters 15.0.32 → 15.0.34
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/converters/fromZigbee.js +1 -0
- package/devices/bitron.js +2 -2
- package/devices/bosch.js +24 -1
- package/devices/ecozy.js +1 -1
- package/devices/elko.js +1 -1
- package/devices/enbrighten.js +12 -0
- package/devices/eurotronic.js +1 -1
- package/devices/frankever.js +2 -1
- package/devices/heiman.js +19 -0
- package/devices/leviton.js +1 -1
- package/devices/lonsonho.js +2 -2
- package/devices/paulmann.js +1 -1
- package/devices/philips.js +1 -1
- package/devices/schneider_electric.js +1 -1
- package/devices/sonoff.js +10 -0
- package/devices/third_reality.js +6 -1
- package/devices/tuya.js +23 -1
- package/devices/xiaomi.js +1 -1
- package/devices/zen.js +1 -1
- package/lib/exposes.js +2 -1
- package/lib/zosung.js +8 -6
- package/package.json +2 -2
package/converters/fromZigbee.js
CHANGED
|
@@ -6111,6 +6111,7 @@ const converters = {
|
|
|
6111
6111
|
let result = null;
|
|
6112
6112
|
|
|
6113
6113
|
if (value === 0) result = {action: 'shake'};
|
|
6114
|
+
else if (value === 1) result = {action: 'throw'};
|
|
6114
6115
|
else if (value === 2) result = {action: 'wakeup'};
|
|
6115
6116
|
else if (value === 3) result = {action: 'fall'};
|
|
6116
6117
|
else if (value >= 512) result = {action: 'tap', side: value-512};
|
package/devices/bitron.js
CHANGED
|
@@ -194,8 +194,8 @@ module.exports = [
|
|
|
194
194
|
tz.thermostat_occupied_cooling_setpoint, tz.thermostat_local_temperature_calibration, tz.thermostat_local_temperature,
|
|
195
195
|
tz.thermostat_running_state, tz.thermostat_temperature_display_mode, tz.thermostat_keypad_lockout, tz.thermostat_system_mode],
|
|
196
196
|
exposes: [e.battery(), exposes.climate().withSetpoint('occupied_heating_setpoint', 7, 30, 0.5).withLocalTemperature()
|
|
197
|
-
.withSystemMode(['off', 'heat']).withRunningState(['idle', 'heat'
|
|
198
|
-
.withLocalTemperatureCalibration(
|
|
197
|
+
.withSystemMode(['off', 'heat']).withRunningState(['idle', 'heat'])
|
|
198
|
+
.withLocalTemperatureCalibration(), e.keypad_lockout()],
|
|
199
199
|
meta: {battery: {voltageToPercentage: '3V_2500_3200'}},
|
|
200
200
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
201
201
|
const endpoint = device.getEndpoint(1);
|
package/devices/bosch.js
CHANGED
|
@@ -202,8 +202,22 @@ const tzLocal = {
|
|
|
202
202
|
};
|
|
203
203
|
|
|
204
204
|
|
|
205
|
-
// Radiator Thermostat II
|
|
206
205
|
const fzLocal = {
|
|
206
|
+
bosch_contact: {
|
|
207
|
+
cluster: 'ssIasZone',
|
|
208
|
+
type: 'commandStatusChangeNotification',
|
|
209
|
+
convert: (model, msg, publish, options, meta) => {
|
|
210
|
+
const zoneStatus = msg.data.zonestatus;
|
|
211
|
+
const lookup = {0: 'none', 1: 'single', 2: 'long'};
|
|
212
|
+
const result = {
|
|
213
|
+
contact: !((zoneStatus & 1) > 0),
|
|
214
|
+
battery_low: (zoneStatus & 1<<3) > 0,
|
|
215
|
+
action: lookup[(zoneStatus >> 11) & 3],
|
|
216
|
+
};
|
|
217
|
+
if (result.action === 'none') delete result.action;
|
|
218
|
+
return result;
|
|
219
|
+
},
|
|
220
|
+
},
|
|
207
221
|
bosch_thermostat: {
|
|
208
222
|
cluster: 'hvacThermostat',
|
|
209
223
|
type: ['attributeReport', 'readResponse'],
|
|
@@ -528,6 +542,15 @@ const definition = [
|
|
|
528
542
|
},
|
|
529
543
|
exposes: [e.switch(), e.power_on_behavior(), e.power(), e.energy()],
|
|
530
544
|
},
|
|
545
|
+
{
|
|
546
|
+
zigbeeModel: ['RBSH-SWD-ZB'],
|
|
547
|
+
model: 'BSEN-C2',
|
|
548
|
+
vendor: 'Bosch',
|
|
549
|
+
description: 'Door/window contact II',
|
|
550
|
+
fromZigbee: [fzLocal.bosch_contact],
|
|
551
|
+
toZigbee: [],
|
|
552
|
+
exposes: [e.battery_low(), e.contact(), e.action(['single', 'long'])],
|
|
553
|
+
},
|
|
531
554
|
{
|
|
532
555
|
zigbeeModel: ['RBSH-SP-ZB-FR'],
|
|
533
556
|
model: 'BSP-EZ2',
|
package/devices/ecozy.js
CHANGED
|
@@ -19,7 +19,7 @@ module.exports = [
|
|
|
19
19
|
tz.thermostat_pi_heating_demand, tz.thermostat_running_state],
|
|
20
20
|
exposes: [e.battery(), exposes.climate().withSetpoint('occupied_heating_setpoint', 7, 30, 1).withLocalTemperature()
|
|
21
21
|
.withSystemMode(['off', 'auto', 'heat']).withRunningState(['idle', 'heat'])
|
|
22
|
-
.withLocalTemperatureCalibration(
|
|
22
|
+
.withLocalTemperatureCalibration()
|
|
23
23
|
.withPiHeatingDemand(ea.STATE_GET)],
|
|
24
24
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
25
25
|
const endpoint = device.getEndpoint(3);
|
package/devices/elko.js
CHANGED
|
@@ -60,7 +60,7 @@ module.exports = [
|
|
|
60
60
|
'(quick) wooden floors.'),
|
|
61
61
|
exposes.climate().withSetpoint('occupied_heating_setpoint', 5, 50, 1)
|
|
62
62
|
.withLocalTemperature(ea.STATE)
|
|
63
|
-
.withLocalTemperatureCalibration(
|
|
63
|
+
.withLocalTemperatureCalibration()
|
|
64
64
|
.withSystemMode(['off', 'heat']).withRunningState(['idle', 'heat']),
|
|
65
65
|
e.temperature_sensor_select(['air', 'floor', 'supervisor_floor']),
|
|
66
66
|
exposes.numeric('floor_temp', ea.STATE_GET).withUnit('°C')
|
package/devices/enbrighten.js
CHANGED
|
@@ -148,4 +148,16 @@ module.exports = [
|
|
|
148
148
|
await reporting.onOff(endpoint);
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
|
+
{
|
|
152
|
+
zigbeeModel: ['43109'],
|
|
153
|
+
model: '43109',
|
|
154
|
+
vendor: 'Enbrighten',
|
|
155
|
+
description: 'Zigbee in-wall smart switch',
|
|
156
|
+
extend: extend.switch(),
|
|
157
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
158
|
+
const endpoint = device.getEndpoint(1);
|
|
159
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
|
|
160
|
+
await reporting.onOff(endpoint);
|
|
161
|
+
},
|
|
162
|
+
},
|
|
151
163
|
];
|
package/devices/eurotronic.js
CHANGED
|
@@ -20,7 +20,7 @@ module.exports = [
|
|
|
20
20
|
tz.eurotronic_current_heating_setpoint, tz.eurotronic_trv_mode, tz.eurotronic_valve_position],
|
|
21
21
|
exposes: [e.battery(), exposes.climate().withSetpoint('occupied_heating_setpoint', 5, 30, 0.5).withLocalTemperature()
|
|
22
22
|
.withSystemMode(['off', 'auto', 'heat']).withRunningState(['idle', 'heat'])
|
|
23
|
-
.withLocalTemperatureCalibration(
|
|
23
|
+
.withLocalTemperatureCalibration()
|
|
24
24
|
.withPiHeatingDemand(),
|
|
25
25
|
exposes.enum('trv_mode', exposes.access.ALL, [1, 2])
|
|
26
26
|
.withDescription('Select between direct control of the valve via the `valve_position` or automatic control of the '+
|
package/devices/frankever.js
CHANGED
|
@@ -7,7 +7,8 @@ const ea = exposes.access;
|
|
|
7
7
|
module.exports = [
|
|
8
8
|
{
|
|
9
9
|
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_wt9agwf3'},
|
|
10
|
-
{modelID: 'TS0601', manufacturerName: '_TZE200_5uodvhgc'}
|
|
10
|
+
{modelID: 'TS0601', manufacturerName: '_TZE200_5uodvhgc'},
|
|
11
|
+
{modelID: 'TS0601', manufacturerName: '_TZE200_1n2zev06'}],
|
|
11
12
|
model: 'FK_V02',
|
|
12
13
|
vendor: 'FrankEver',
|
|
13
14
|
description: 'Zigbee smart water valve',
|
package/devices/heiman.js
CHANGED
|
@@ -475,6 +475,25 @@ module.exports = [
|
|
|
475
475
|
await reporting.batteryPercentageRemaining(endpoint, {min: constants.repInterval.MINUTES_5, max: constants.repInterval.HOUR});
|
|
476
476
|
},
|
|
477
477
|
},
|
|
478
|
+
{
|
|
479
|
+
zigbeeModel: ['HS3HT-EFA-3.0'],
|
|
480
|
+
model: 'HS3HT',
|
|
481
|
+
vendor: 'HEIMAN',
|
|
482
|
+
description: 'Temperature & humidity sensor with display',
|
|
483
|
+
fromZigbee: [fz.temperature, fz.humidity, fz.battery],
|
|
484
|
+
toZigbee: [],
|
|
485
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
486
|
+
const endpoint1 = device.getEndpoint(1);
|
|
487
|
+
await reporting.bind(endpoint1, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
|
|
488
|
+
await reporting.temperature(endpoint1);
|
|
489
|
+
await reporting.batteryPercentageRemaining(endpoint1);
|
|
490
|
+
await endpoint1.read('genPowerCfg', ['batteryPercentageRemaining']);
|
|
491
|
+
const endpoint2 = device.getEndpoint(2);
|
|
492
|
+
await reporting.bind(endpoint2, coordinatorEndpoint, ['msRelativeHumidity']);
|
|
493
|
+
await reporting.humidity(endpoint2);
|
|
494
|
+
},
|
|
495
|
+
exposes: [e.battery(), e.temperature(), e.humidity()],
|
|
496
|
+
},
|
|
478
497
|
{
|
|
479
498
|
zigbeeModel: ['GASSensor-EM', '358e4e3e03c644709905034dae81433e'],
|
|
480
499
|
model: 'HS1CG-E',
|
package/devices/leviton.js
CHANGED
|
@@ -111,7 +111,7 @@ module.exports = [
|
|
|
111
111
|
exposes.climate().withSetpoint('occupied_heating_setpoint', 10, 30, 1).withLocalTemperature()
|
|
112
112
|
.withSystemMode(['off', 'auto', 'heat', 'cool']).withFanMode(['auto', 'on', 'smart'])
|
|
113
113
|
.withSetpoint('occupied_cooling_setpoint', 10, 30, 1)
|
|
114
|
-
.withLocalTemperatureCalibration(
|
|
114
|
+
.withLocalTemperatureCalibration().withPiHeatingDemand()],
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
// Reference from a similar switch: https://gist.github.com/nebhead/dc5a0a827ec14eef6196ded4be6e2dd0
|
package/devices/lonsonho.js
CHANGED
|
@@ -119,7 +119,7 @@ module.exports = [
|
|
|
119
119
|
exposes: [e.light_brightness().withMinBrightness()],
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
|
-
fingerprint: [{modelID: 'TS110F', manufacturerName: '_TYZB01_v8gtiaed'}
|
|
122
|
+
fingerprint: [{modelID: 'TS110F', manufacturerName: '_TYZB01_v8gtiaed'}],
|
|
123
123
|
model: 'QS-Zigbee-D02-TRIAC-2C-LN',
|
|
124
124
|
vendor: 'Lonsonho',
|
|
125
125
|
description: '2 gang smart dimmer switch module with neutral',
|
|
@@ -139,7 +139,7 @@ module.exports = [
|
|
|
139
139
|
},
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
|
-
fingerprint: [{modelID: 'TS110F', manufacturerName: '_TZ3000_92chsky7'}
|
|
142
|
+
fingerprint: [{modelID: 'TS110F', manufacturerName: '_TZ3000_92chsky7'}],
|
|
143
143
|
model: 'QS-Zigbee-D02-TRIAC-2C-L',
|
|
144
144
|
vendor: 'Lonsonho',
|
|
145
145
|
description: '2 gang smart dimmer switch module without neutral',
|
package/devices/paulmann.js
CHANGED
|
@@ -9,7 +9,7 @@ module.exports = [
|
|
|
9
9
|
model: '501.34',
|
|
10
10
|
vendor: 'Paulmann',
|
|
11
11
|
description: 'Smart switch 4 buttons white',
|
|
12
|
-
fromZigbee: [fz.command_on, fz.command_off, fz.battery],
|
|
12
|
+
fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop],
|
|
13
13
|
toZigbee: [],
|
|
14
14
|
exposes: [e.battery(), e.action(['on_1', 'off_1', 'on_2', 'off_2', 'brightness_move_up_1', 'brightness_move_down_1',
|
|
15
15
|
'brightness_move_stop_1', 'brightness_move_up_2', 'brightness_move_down_2', 'brightness_move_stop_2'])],
|
package/devices/philips.js
CHANGED
|
@@ -815,7 +815,7 @@ module.exports = [
|
|
|
815
815
|
model: '8718699688882',
|
|
816
816
|
vendor: 'Philips',
|
|
817
817
|
description: 'Hue white Filament bulb G93 E27 bluetooth',
|
|
818
|
-
extend: philips.extend.light_onoff_brightness(),
|
|
818
|
+
extend: philips.extend.light_onoff_brightness({disableHueEffects: false}),
|
|
819
819
|
},
|
|
820
820
|
{
|
|
821
821
|
zigbeeModel: ['LST001'],
|
|
@@ -704,7 +704,7 @@ module.exports = [
|
|
|
704
704
|
exposes.climate()
|
|
705
705
|
.withSetpoint('occupied_heating_setpoint', 7, 30, 0.5, ea.STATE_SET)
|
|
706
706
|
.withLocalTemperature(ea.STATE)
|
|
707
|
-
.withLocalTemperatureCalibration(-
|
|
707
|
+
.withLocalTemperatureCalibration(-12.8, 12.7, 0.1, ea.STATE_SET)
|
|
708
708
|
.withPiHeatingDemand()],
|
|
709
709
|
meta: {battery: {voltageToPercentage: '3V_2500'}},
|
|
710
710
|
configure: async (device, coordinatorEndpoint, logger) => {
|
package/devices/sonoff.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const exposes = require('../lib/exposes');
|
|
2
2
|
const fz = require('../converters/fromZigbee');
|
|
3
|
+
const tz = require('../converters/toZigbee');
|
|
3
4
|
const constants = require('../lib/constants');
|
|
4
5
|
const reporting = require('../lib/reporting');
|
|
5
6
|
const extend = require('../lib/extend');
|
|
@@ -246,4 +247,13 @@ module.exports = [
|
|
|
246
247
|
device.save();
|
|
247
248
|
},
|
|
248
249
|
},
|
|
250
|
+
{
|
|
251
|
+
zigbeeModel: ['ZBCurtain'],
|
|
252
|
+
model: 'ZBCurtain',
|
|
253
|
+
vendor: 'SONOFF',
|
|
254
|
+
description: 'Zigbee smart curtain motor',
|
|
255
|
+
fromZigbee: [fz.cover_position_tilt, fz.battery],
|
|
256
|
+
toZigbee: [tz.cover_state, tz.cover_position_tilt],
|
|
257
|
+
exposes: [e.cover_position(), e.battery()],
|
|
258
|
+
},
|
|
249
259
|
];
|
package/devices/third_reality.js
CHANGED
|
@@ -15,7 +15,12 @@ module.exports = [
|
|
|
15
15
|
ota: ota.zigbeeOTA,
|
|
16
16
|
fromZigbee: [fz.on_off, fz.battery],
|
|
17
17
|
toZigbee: [tz.on_off, tz.ignore_transition],
|
|
18
|
-
|
|
18
|
+
meta: {battery: {dontDividePercentage: true}},
|
|
19
|
+
exposes: [e.switch(), e.battery(), e.battery_voltage()],
|
|
20
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
21
|
+
device.powerSource = 'Battery';
|
|
22
|
+
device.save();
|
|
23
|
+
},
|
|
19
24
|
},
|
|
20
25
|
{
|
|
21
26
|
zigbeeModel: ['3RSS008Z'],
|
package/devices/tuya.js
CHANGED
|
@@ -3886,7 +3886,7 @@ module.exports = [
|
|
|
3886
3886
|
},
|
|
3887
3887
|
{
|
|
3888
3888
|
fingerprint: [{modelID: 'TS110E', manufacturerName: '_TZ3210_wdexaypg'}, {modelID: 'TS110E', manufacturerName: '_TZ3210_3mpwqzuu'}],
|
|
3889
|
-
model: '
|
|
3889
|
+
model: 'TS110E_2gang_1',
|
|
3890
3890
|
vendor: 'TuYa',
|
|
3891
3891
|
description: '2 channel dimmer',
|
|
3892
3892
|
fromZigbee: extend.light_onoff_brightness({disablePowerOnBehavior: true, disableMoveStep: true, disableTransition: true})
|
|
@@ -3911,6 +3911,28 @@ module.exports = [
|
|
|
3911
3911
|
return {l1: 1, l2: 2};
|
|
3912
3912
|
},
|
|
3913
3913
|
},
|
|
3914
|
+
{
|
|
3915
|
+
fingerprint: tuya.fingerprint('TS110E', ['_TZ3210_pagajpog', '_TZ3210_4ubylghk']),
|
|
3916
|
+
model: 'TS110E_2gang_2',
|
|
3917
|
+
vendor: 'TuYa',
|
|
3918
|
+
description: '2 channel dimmer',
|
|
3919
|
+
fromZigbee: [fzLocal.TS110E, fzLocal.TS110E_light_type, tuya.fz.power_on_behavior, fz.on_off],
|
|
3920
|
+
toZigbee: [tzLocal.TS110E_onoff_brightness, tzLocal.TS110E_options, tuya.tz.power_on_behavior, tz.light_brightness_move],
|
|
3921
|
+
meta: {multiEndpoint: true},
|
|
3922
|
+
exposes: [
|
|
3923
|
+
e.light_brightness().withMinBrightness().withMaxBrightness().withEndpoint('l1'),
|
|
3924
|
+
e.light_brightness().withMinBrightness().withMaxBrightness().withEndpoint('l2'),
|
|
3925
|
+
e.power_on_behavior().withAccess(ea.ALL)],
|
|
3926
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
3927
|
+
await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
|
|
3928
|
+
const endpoint = device.getEndpoint(1);
|
|
3929
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
|
|
3930
|
+
await reporting.onOff(endpoint);
|
|
3931
|
+
},
|
|
3932
|
+
endpoint: (device) => {
|
|
3933
|
+
return {l1: 1, l2: 2};
|
|
3934
|
+
},
|
|
3935
|
+
},
|
|
3914
3936
|
{
|
|
3915
3937
|
fingerprint: tuya.fingerprint('TS0601', ['_TZE200_nslr42tt']),
|
|
3916
3938
|
model: 'TS0601_3_phase_clamp_meter',
|
package/devices/xiaomi.js
CHANGED
|
@@ -1782,7 +1782,7 @@ module.exports = [
|
|
|
1782
1782
|
fromZigbee: [fz.xiaomi_basic, fz.MFKZQ01LM_action_multistate, fz.MFKZQ01LM_action_analog],
|
|
1783
1783
|
exposes: [e.battery(), e.battery_voltage(), e.angle('action_angle'), e.device_temperature(), e.power_outage_count(false),
|
|
1784
1784
|
e.cube_side('action_from_side'), e.cube_side('action_side'), e.cube_side('action_to_side'), e.cube_side('side'),
|
|
1785
|
-
e.action(['shake', 'wakeup', 'fall', 'tap', 'slide', 'flip180', 'flip90', 'rotate_left', 'rotate_right'])],
|
|
1785
|
+
e.action(['shake', 'throw', 'wakeup', 'fall', 'tap', 'slide', 'flip180', 'flip90', 'rotate_left', 'rotate_right'])],
|
|
1786
1786
|
toZigbee: [],
|
|
1787
1787
|
},
|
|
1788
1788
|
{
|
package/devices/zen.js
CHANGED
|
@@ -18,7 +18,7 @@ module.exports = [
|
|
|
18
18
|
exposes: [exposes.climate().withSetpoint('occupied_heating_setpoint', 10, 30, 0.5)
|
|
19
19
|
.withSetpoint('occupied_cooling_setpoint', 10, 31, 0.5).withLocalTemperature()
|
|
20
20
|
.withSystemMode(['off', 'auto', 'heat', 'cool']).withRunningState(['idle', 'heat', 'cool'])
|
|
21
|
-
.withLocalTemperatureCalibration(
|
|
21
|
+
.withLocalTemperatureCalibration().withPiHeatingDemand()],
|
|
22
22
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
23
23
|
const endpoint = device.getEndpoint(3) || device.getEndpoint(1);
|
|
24
24
|
const binds = ['genBasic', 'genIdentify', 'genPowerCfg', 'genTime', 'hvacThermostat', 'hvacUserInterfaceCfg'];
|
package/lib/exposes.js
CHANGED
|
@@ -391,7 +391,8 @@ class Climate extends Base {
|
|
|
391
391
|
return this;
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
withLocalTemperatureCalibration(min, max, step, access=a.ALL) {
|
|
394
|
+
withLocalTemperatureCalibration(min=-12.8, max=12.7, step=0.1, access=a.ALL) {
|
|
395
|
+
// For devices following the ZCL local_temperature_calibration is an int8, so min = -12.8 and max 12.7
|
|
395
396
|
assert(!this.endpoint, 'Cannot add feature after adding endpoint');
|
|
396
397
|
this.features.push(new Numeric('local_temperature_calibration', access)
|
|
397
398
|
.withValueMin(min).withValueMax(max).withValueStep(step).withUnit('°C').withDescription('Offset to be used in the local_temperature'));
|
package/lib/zosung.js
CHANGED
|
@@ -10,8 +10,9 @@ function nextSeq(entity) {
|
|
|
10
10
|
|
|
11
11
|
function messagesGet(entity, seq) {
|
|
12
12
|
const info = entity.irMessageInfo;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const expected = (info&&info.seq) || 0;
|
|
14
|
+
if (expected!==seq) {
|
|
15
|
+
throw new Error(`Unexpected sequence value (expected: ${expected} current: ${seq}).`);
|
|
15
16
|
}
|
|
16
17
|
return info.data;
|
|
17
18
|
}
|
|
@@ -21,18 +22,19 @@ function messagesSet(entity, seq, data) {
|
|
|
21
22
|
|
|
22
23
|
function messagesClear(entity, seq) {
|
|
23
24
|
const info = entity.irMessageInfo;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const expected = (info&&info.seq) || 0;
|
|
26
|
+
if (expected!==seq) {
|
|
27
|
+
throw new Error(`Unexpected sequence value (expected: ${expected} current: ${seq}).`);
|
|
26
28
|
}
|
|
27
29
|
delete entity.irMessageInfo;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
function calcArrayCrc(values) {
|
|
31
|
-
return Array.from(values.values()).reduce((a, b)=>a+b)%0x100;
|
|
33
|
+
return Array.from(values.values()).reduce((a, b)=>a+b, 0)%0x100;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
function calcStringCrc(str) {
|
|
35
|
-
return str.split('').map((x)=>x.charCodeAt(0)).reduce((a, b)=>a+b)%0x100;
|
|
37
|
+
return str.split('').map((x)=>x.charCodeAt(0)).reduce((a, b)=>a+b, 0)%0x100;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zigbee-herdsman-converters",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.34",
|
|
4
4
|
"description": "Collection of device converters to be used with zigbee-herdsman",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/Koenkk/zigbee-herdsman-converters",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"axios": "^1.2.
|
|
37
|
+
"axios": "^1.2.6",
|
|
38
38
|
"buffer-crc32": "^0.2.13",
|
|
39
39
|
"https-proxy-agent": "^5.0.1",
|
|
40
40
|
"tar-stream": "^3.0.0",
|