forked from Koenkk/zigbee-herdsman-converters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdanalock.js
23 lines (22 loc) · 933 Bytes
/
danalock.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const reporting = require('../lib/reporting');
const e = exposes.presets;
module.exports = [
{
zigbeeModel: ['V3-BTZB', 'V3-BTZBE'],
model: 'V3-BTZB/V3-BTZBE',
vendor: 'Danalock',
description: 'BT/ZB smartlock',
fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery],
toZigbee: [tz.lock],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']);
await reporting.lockState(endpoint);
await reporting.batteryPercentageRemaining(endpoint);
},
exposes: [e.lock(), e.battery()],
},
];