|
发表于 2022-12-5 11:18:28
|
显示全部楼层
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 = {
// Since a lot of TuYa devices use the same modelID, but use different datapoints
// it's necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
// The model ID from: Device with modelID 'TS0601' is not supported
// You may need to add \u0000 at the end of the name in some cases
modelID: 'TS0601',
// The manufacturer name from: Device with modelID 'TS0601' is not supported.
manufacturerName: '_TZE200_xu4a5rhj',
},
],
model: 'TS0601_cover',
vendor: 'TuYa',
description: 'Curtain motor',
fromZigbee: [fz.tuya_cover, fz.ignore_basic_report],
toZigbee: [tz.tuya_cover_control, tz.tuya_cover_options],
exposes: [
e.cover_position().setAccess('position', ea.STATE_SET),
exposes.composite('options', 'options')
.withFeature(exposes.numeric('motor_speed', ea.STATE_SET)
.withValueMin(0)
.withValueMax(255)
.withDescription('Motor speed'))],
};
module.exports = definition; |
|