forked from Koenkk/zigbee-herdsman-converters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ITCommander.js
37 lines (36 loc) · 1.43 KB
/
ITCommander.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const exposes = require('../lib/exposes');
const e = exposes.presets;
const reporting = require('../lib/reporting');
module.exports = [
{
zigbeeModel: ['ITCMDR_Contact'],
model: 'ITCMDR_Contact',
vendor: 'IT Commander',
description: 'Contact Sensor',
fromZigbee: [fz.ias_contact_alarm_1, fz.battery],
toZigbee: [],
exposes: [e.contact(), e.battery(), e.voltage()],
configure: async (device, coordinatorEndpoint) => {
for (const ep of [1, 2, 3]) {
await reporting.bind(device.getEndpoint(ep), coordinatorEndpoint, ['genPowerCfg', 'ssIasZone']);
}
},
},
{
zigbeeModel: ['ITCMDR_Click'],
model: 'ITCMDR_Click',
vendor: 'IT Commander',
description: 'Button',
exposes: [e.action(['single', 'double', 'triple', 'hold', 'release', 'many']), e.battery(), e.voltage()],
fromZigbee: [fz.itcmdr_clicks, fz.battery],
toZigbee: [],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
device.endpoints.forEach(async (ep) => {
await reporting.bind(ep, coordinatorEndpoint, ['genMultistateInput']);
});
},
},
];