UNPKG

zigbee-herdsman-converters

Version:

Collection of device converters to be used with zigbee-herdsman

48 lines (46 loc) 1.78 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 extend = require('../lib/extend'); const e = exposes.presets; module.exports = [ { zigbeeModel: ['GWA1521_Actuator_1_CH_PF'], model: 'GWA1521', description: 'Switch actuator 1 channel with input', vendor: 'Gewiss', extend: extend.switch(), configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']); await reporting.onOff(endpoint); }, }, { zigbeeModel: ['GWA1522_Actuator_2_CH'], model: 'GWA1522', description: 'Switch actuator 2 channels with input', vendor: 'Gewiss', extend: extend.switch(), exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')], meta: {multiEndpoint: true}, endpoint: (device) => { return {'l1': 1, 'l2': 2}; }, }, { zigbeeModel: ['GWA1531_Shutter'], model: 'GWA1531', description: 'Shutter actuator', vendor: 'Gewiss', fromZigbee: [fz.cover_position_tilt, fz.ignore_basic_report], toZigbee: [tz.cover_state, tz.cover_position_tilt], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genLevelCtrl']); await reporting.brightness(endpoint); }, exposes: [e.cover_position()], }, ];