|
大佬们能发一个涂鸦设备的转换器文件吗? 型号是 [color=rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1))]TY0003 三开的零火开关面板。我自己照着网上教程 弄了个 一点反应没有。
不知道是哪里出了问题。求助!
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ['TY0003'],
model: 'ZB-SW03',
vendor: 'eWeLink',
description: 'Smart light switch - 3 gang',
extend: preset.switch(),
exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right')],
endpoint: (device) => {
return {'left': 1, 'center': 2, 'right': 3};
},
meta: {configureKey: 1, multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
},
onEvent: async (type, data, device) => {
device.skipDefaultResponse = true;
},
};
module.exports = definition;
|
|