// Название: UseeLink Zigbee 3.0 Smart Strip // modelID: TS0115 // manufacturerName: _TYZB01_vkwryfdr const exposes = require('zigbee-herdsman-converters/lib/exposes'); const fz = {...require('zigbee-herdsman-converters/converters/fromZigbee'), legacy: require('zigbee-herdsman-converters/lib/legacy').fromZigbee}; const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const globalStore = require('zigbee-herdsman-converters/lib/store'); const ota = require('zigbee-herdsman-converters/lib/ota'); const tuya = require('zigbee-herdsman-converters/lib/tuya'); 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: ['TS0115'], model: 'TS0115 ', vendor: 'TuYa', description: 'Multiprise with 4 AC outlets and 2 USB super charging ports (10A or 16A)', toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior]), fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior]), extend: extend.switch(), exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.switch().withEndpoint('l3'), e.switch().withEndpoint('l4'), e.switch().withEndpoint('l5'), e.power_on_behavior()], whiteLabel: [{vendor: 'UseeLink', model: 'SM-SO306E/K/M'}], endpoint: (device) => { return {l1: 1, l2: 2, l3: 3, l4: 4, l5: 7}; }, meta: {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']); await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']); await reporting.bind(device.getEndpoint(7), coordinatorEndpoint, ['genOnOff']); await device.getEndpoint(1).read('genOnOff', ['onOff', 'moesStartUpOnOff']); await device.getEndpoint(2).read('genOnOff', ['onOff']); await device.getEndpoint(3).read('genOnOff', ['onOff']); await device.getEndpoint(4).read('genOnOff', ['onOff']); await device.getEndpoint(7).read('genOnOff', ['onOff']); }, }; module.exports = definition;