UNPKG

zigbee-herdsman-converters

Version:

Collection of device converters to be used with zigbee-herdsman

72 lines (70 loc) 3.15 kB
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: ['SMARTCODE_CONVERT_GEN1'], model: '66492-001', vendor: 'Kwikset', description: 'Home connect smart lock conversion kit', fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery], toZigbee: [tz.lock], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(2); await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']); await reporting.lockState(endpoint); await reporting.batteryPercentageRemaining(endpoint); }, exposes: [e.lock(), e.battery()], }, { zigbeeModel: ['SMARTCODE_DEADBOLT_10_L'], model: '99140-002', vendor: 'Kwikset', description: 'SmartCode traditional electronic deadbolt', fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery], toZigbee: [tz.lock], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(2); await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']); await reporting.lockState(endpoint); await reporting.batteryPercentageRemaining(endpoint); }, exposes: [e.lock(), e.battery()], }, { zigbeeModel: ['SMARTCODE_DEADBOLT_5'], model: '99100-045', vendor: 'Kwikset', description: '910 SmartCode traditional electronic deadbolt', fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery, fz.lock_programming_event, fz.lock_pin_code_response], toZigbee: [tz.lock, tz.pincode_lock], meta: {pinCodeCount: 30}, configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(2); console.log(device); console.log(endpoint.clusters); await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']); await reporting.lockState(endpoint); await reporting.batteryPercentageRemaining(endpoint); }, exposes: [e.lock(), e.battery()], }, { zigbeeModel: ['SMARTCODE_DEADBOLT_5_L'], model: '99100-006', vendor: 'Kwikset', description: '910 SmartCode traditional electronic deadbolt', fromZigbee: [fz.lock, fz.lock_operation_event, fz.battery], toZigbee: [tz.lock], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(2); await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']); await reporting.lockState(endpoint); await reporting.batteryPercentageRemaining(endpoint); }, exposes: [e.lock(), e.battery()], }, ];