zigbee-herdsman-converters 14.0.598 → 14.0.599
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/devices/heiman.js +1 -1
- package/devices/namron.js +20 -5
- package/package.json +1 -1
package/devices/heiman.js
CHANGED
|
@@ -211,7 +211,7 @@ module.exports = [
|
|
|
211
211
|
description: 'Smart remote controller',
|
|
212
212
|
fromZigbee: [fz.battery, fz.command_arm, fz.command_emergency],
|
|
213
213
|
toZigbee: [],
|
|
214
|
-
exposes: [e.battery(), e.action(['emergency', 'disarm', '
|
|
214
|
+
exposes: [e.battery(), e.action(['emergency', 'disarm', 'arm_day_zones', 'arm_all_zones'])],
|
|
215
215
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
216
216
|
const endpoint = device.getEndpoint(1);
|
|
217
217
|
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
|
package/devices/namron.js
CHANGED
|
@@ -3,6 +3,7 @@ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/lega
|
|
|
3
3
|
const tz = require('../converters/toZigbee');
|
|
4
4
|
const constants = require('../lib/constants');
|
|
5
5
|
const reporting = require('../lib/reporting');
|
|
6
|
+
const globalStore = require('../lib/store');
|
|
6
7
|
const extend = require('../lib/extend');
|
|
7
8
|
const ea = exposes.access;
|
|
8
9
|
const e = exposes.presets;
|
|
@@ -340,6 +341,25 @@ module.exports = [
|
|
|
340
341
|
.withValueMin(20).withValueMax(60)
|
|
341
342
|
.withDescription('Room temperature alarm threshold, between 20 and 60 in °C. 0 means disabled. Default: 45.'),
|
|
342
343
|
],
|
|
344
|
+
onEvent: async (type, data, device, options) => {
|
|
345
|
+
const endpoint = device.getEndpoint(1);
|
|
346
|
+
if (type === 'stop') {
|
|
347
|
+
clearInterval(globalStore.getValue(device, 'time'));
|
|
348
|
+
globalStore.clearValue(device, 'time');
|
|
349
|
+
} else if (!globalStore.hasValue(device, 'time')) {
|
|
350
|
+
const hours24 = 1000 * 60 * 60 * 24;
|
|
351
|
+
const interval = setInterval(async () => {
|
|
352
|
+
try {
|
|
353
|
+
// Device does not asks for the time with binding, therefore we write the time every 24 hours
|
|
354
|
+
const time = Math.round(((new Date()).getTime() - constants.OneJanuary2000) / 1000 + ((new Date())
|
|
355
|
+
.getTimezoneOffset() * -1) * 60);
|
|
356
|
+
const values = {time: time};
|
|
357
|
+
endpoint.write('genTime', values);
|
|
358
|
+
} catch (error) {/* Do nothing*/}
|
|
359
|
+
}, hours24);
|
|
360
|
+
globalStore.putValue(device, 'time', interval);
|
|
361
|
+
}
|
|
362
|
+
},
|
|
343
363
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
344
364
|
const endpoint = device.getEndpoint(1);
|
|
345
365
|
const binds = [
|
|
@@ -474,11 +494,6 @@ module.exports = [
|
|
|
474
494
|
reportableChange: null}],
|
|
475
495
|
options);
|
|
476
496
|
|
|
477
|
-
// Device does not asks for the time with binding, we need to write time during configure
|
|
478
|
-
const time = Math.round(((new Date()).getTime() - constants.OneJanuary2000) / 1000);
|
|
479
|
-
const values = {time: time};
|
|
480
|
-
endpoint.write('genTime', values);
|
|
481
|
-
|
|
482
497
|
// Trigger initial read
|
|
483
498
|
await endpoint.read('hvacThermostat', ['systemMode', 'runningState', 'occupiedHeatingSetpoint']);
|
|
484
499
|
await endpoint.read('hvacThermostat', [0x1000, 0x1001, 0x1002, 0x1003], options);
|