"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.definitions = void 0;
const zigbee_herdsman_1 = require("zigbee-herdsman");
const fz = __importStar(require("../converters/fromZigbee"));
const ewelink_1 = require("../lib/ewelink");
const exposes = __importStar(require("../lib/exposes"));
const logger_1 = require("../lib/logger");
const m = __importStar(require("../lib/modernExtend"));
const reporting = __importStar(require("../lib/reporting"));
const tuya = __importStar(require("../lib/tuya"));
const utils = __importStar(require("../lib/utils"));
const e = exposes.presets;
const ea = exposes.access;
const NS = "zhc:ewelink";
const fzLocal = {
    // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
    WS01_rain: {
        cluster: "ssIasZone",
        type: "commandStatusChangeNotification",
        convert: (model, msg, publish, options, meta) => {
            const zoneStatus = msg.data.zonestatus;
            if (msg.endpoint.ID !== 1)
                return;
            return { rain: (zoneStatus & 1) > 0 };
        },
    },
    ewelink_siren_alarm: {
        cluster: "genOnOff",
        type: ["attributeReport", "readResponse"],
        convert: (model, msg, publish, options, meta) => {
            if (msg.data.onOff !== undefined) {
                return { alarm: msg.data.onOff === 1 };
            }
        },
    },
    ewelink_countdown: {
        cluster: "genOnOff",
        type: ["attributeReport", "readResponse"],
        convert: (model, msg, publish, options, meta) => {
            // genOnOff.onTime holds the remaining on-time in 1/10 s while a timed-off countdown is running.
            if (msg.data.onTime !== undefined) {
                return { countdown: Math.round(msg.data.onTime / 10) };
            }
        },
    },
};
const tzLocal = {
    ewelink_siren_alarm: {
        key: ["alarm"],
        convertSet: async (entity, key, value, meta) => {
            const alarm = value === true || value === "ON";
            await entity.command("genOnOff", alarm ? "on" : "off", {}, utils.getOptions(meta.mapped, entity));
            return { state: { alarm } };
        },
        convertGet: async (entity, key, meta) => {
            await entity.read("genOnOff", ["onOff"]);
        },
    },
    ewelink_countdown: {
        key: ["countdown"],
        convertSet: async (entity, key, value, meta) => {
            utils.assertNumber(value, key);
            const seconds = Math.round(value);
            if (seconds <= 0) {
                await entity.command("genOnOff", "off", {}, utils.getOptions(meta.mapped, entity));
                return { state: { state: "OFF", countdown: 0 } };
            }
            // genOnOff.onWithTimedOff expects ontime/offwaittime in 1/10 s; onTime is a uint16 capped at 0xFFFE.
            const ontime = Math.min(seconds * 10, 0xfffe);
            await entity.command("genOnOff", "onWithTimedOff", { ctrlbits: 0, ontime, offwaittime: 0 }, utils.getOptions(meta.mapped, entity));
            return { state: { state: "ON", countdown: Math.floor(ontime / 10) } };
        },
        convertGet: async (entity, key, meta) => {
            await entity.read("genOnOff", ["onTime"]);
        },
    },
};
const ewelinkExtend = {
    countdown: () => {
        const exposes = [
            e
                .numeric("countdown", ea.STATE_SET)
                .withUnit("s")
                .withValueMin(0)
                .withValueMax(6500)
                .withValueStep(1)
                .withDescription("Turn the device on and automatically turn it off again after this many seconds (0 disables the timer)"),
        ];
        const fromZigbee = [fzLocal.ewelink_countdown];
        const toZigbee = [tzLocal.ewelink_countdown];
        return { exposes, fromZigbee, toZigbee, isModernExtend: true };
    },
    addCustomClusterSiren: () => {
        return m.deviceAddCustomCluster("customEwelinkSiren", {
            name: "customEwelinkSiren",
            ID: 0xfc11,
            attributes: {
                alarmSoundMode: { name: "alarmSoundMode", ID: 0x2021, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
                alarmSoundLevel: { name: "alarmSoundLevel", ID: 0x2022, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
                alarmSoundTime: { name: "alarmSoundTime", ID: 0x2023, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
            },
            commands: {},
            commandsResponse: {},
        });
    },
    sirenAlarm: () => {
        const exposes = [e.binary("alarm", ea.ALL, true, false).withDescription("Turn the siren alarm on or off")];
        const fromZigbee = [fzLocal.ewelink_siren_alarm];
        const toZigbee = [tzLocal.ewelink_siren_alarm];
        const configure = [
            async (device, coordinatorEndpoint) => {
                try {
                    await m.setupAttributes(device, coordinatorEndpoint, "genOnOff", [{ attribute: "onOff", min: "MIN", max: "MAX", change: 1 }]);
                }
                catch (error) {
                    logger_1.logger.warning(`eWeLink siren genOnOff bind/reporting failed, continuing without reporting: ${error}`, NS);
                }
            },
        ];
        return { exposes, fromZigbee, toZigbee, configure, isModernExtend: true };
    },
};
exports.definitions = [
    {
        fingerprint: tuya.fingerprint("TS0207", ["_TZ3000_hgm6k8ku", "_TZ3000_piuensvr", "_TZ3000_mmzmkkd4"]),
        zigbeeModel: ["CK-BL702-ROUTER-01(7018)"],
        model: "CK-BL702-ROUTER-01(7018)",
        vendor: "eWeLink",
        description: "USB router",
        fromZigbee: [fz.linkquality_from_basic],
        toZigbee: [],
        exposes: [],
        whiteLabel: [
            tuya.whitelabel("HOBEIAN", "ZG-807Z", "USB signal repeater", ["_TZ3000_piuensvr", "_TZ3000_hgm6k8ku", "HOBEIAN"]),
            tuya.whitelabel("COOLO", "ZG-807ZL", "USB signal repeater", ["_TZ3000_mmzmkkd4", "COOLO"]),
        ],
    },
    {
        zigbeeModel: ["CK-BL702-MSW-01(7010)", "CK-BL702-MSW-01(7011)-1"],
        model: "CK-BL702-MSW-01(7010)",
        vendor: "eWeLink",
        description: "CMARS Zigbee smart plug",
        extend: [m.onOff({ skipDuplicateTransaction: true }), m.skipDefaultResponse(), ewelinkExtend.countdown()],
        whiteLabel: [
            {
                vendor: "Mumubiz",
                model: "CZV20",
                description: "Zigbee smart water valve",
                fingerprint: [{ modelID: "CK-BL702-MSW-01(7010)" }],
            },
        ],
    },
    {
        zigbeeModel: ["SA-003-Zigbee"],
        model: "SA-003-Zigbee",
        vendor: "eWeLink",
        description: "Zigbee smart plug",
        extend: [m.onOff({ powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false }), m.skipDefaultResponse()],
        configure: async (device, coordinatorEndpoint) => {
            try {
                await device.getEndpoint(1).bind("genOnOff", coordinatorEndpoint);
            }
            catch {
                // This might fail because there are some repeaters which advertise to support genOnOff but don't support it.
                // https://github.com/Koenkk/zigbee2mqtt/issues/19865
                logger_1.logger.debug("Failed to bind genOnOff for SA-003-Zigbee", NS);
            }
        },
    },
    {
        zigbeeModel: ["SA-030-1"],
        model: "SA-030-1",
        vendor: "eWeLink",
        description: "Zigbee 3.0 smart plug 13A (3120W)(UK version)",
        extend: [m.onOff({ skipDuplicateTransaction: true }), m.skipDefaultResponse()],
    },
    {
        zigbeeModel: ["SWITCH-ZR02"],
        model: "SWITCH-ZR02",
        vendor: "eWeLink",
        description: "Zigbee smart switch",
        extend: [m.onOff({ powerOnBehavior: false, skipDuplicateTransaction: true }), m.skipDefaultResponse()],
    },
    {
        zigbeeModel: ["SWITCH-ZR03-1"],
        model: "SWITCH-ZR03-1",
        vendor: "eWeLink",
        description: "Zigbee smart switch",
        extend: [m.onOff({ skipDuplicateTransaction: true }), m.skipDefaultResponse()],
    },
    {
        zigbeeModel: ["ZB-SW01"],
        model: "ZB-SW01",
        vendor: "eWeLink",
        description: "Smart light switch - 1 gang",
        extend: [m.onOff({ powerOnBehavior: false, skipDuplicateTransaction: true, configureReporting: false }), m.skipDefaultResponse()],
    },
    {
        zigbeeModel: ["ZB-SW02", "E220-KR2N0Z0-HA", "SWITCH-ZR03-2"],
        model: "ZB-SW02",
        vendor: "eWeLink",
        description: "Smart light switch/2 gang relay",
        extend: [
            m.deviceEndpoints({ endpoints: { left: 1, right: 2 } }),
            m.onOff({ endpointNames: ["left", "right"], configureReporting: false }),
            m.skipDefaultResponse(),
        ],
    },
    {
        zigbeeModel: ["ZB-SW03"],
        model: "ZB-SW03",
        vendor: "eWeLink",
        description: "Smart light switch - 3 gang",
        extend: [
            m.deviceEndpoints({ endpoints: { left: 1, center: 2, right: 3 } }),
            m.onOff({ endpointNames: ["left", "center", "right"], configureReporting: false }),
            m.skipDefaultResponse(),
        ],
    },
    {
        zigbeeModel: ["ZB-SW04"],
        model: "ZB-SW04",
        vendor: "eWeLink",
        description: "Smart light switch - 4 gang",
        extend: [
            m.deviceEndpoints({ endpoints: { l1: 1, l2: 2, l3: 3, l4: 4 } }),
            m.onOff({ endpointNames: ["l1", "l2", "l3", "l4"], configureReporting: false }),
            m.skipDefaultResponse(),
        ],
    },
    {
        zigbeeModel: ["ZB-SW05"],
        model: "ZB-SW05",
        vendor: "eWeLink",
        description: "Smart light switch - 5 gang",
        extend: [
            m.deviceEndpoints({ endpoints: { l1: 1, l2: 2, l3: 3, l4: 4, l5: 5 } }),
            m.onOff({ endpointNames: ["l1", "l2", "l3", "l4", "l5"], configureReporting: false }),
            m.skipDefaultResponse(),
        ],
    },
    {
        zigbeeModel: ["WS01"],
        model: "WS01",
        vendor: "eWeLink",
        description: "Rainfall sensor",
        fromZigbee: [fzLocal.WS01_rain],
        toZigbee: [],
        exposes: [e.rain()],
    },
    {
        zigbeeModel: ["CK-TLSR8656-SS5-02(7014)"],
        model: "CK-TLSR8656-SS5-02(7014)",
        vendor: "eWeLink",
        description: "Temperature & humidity sensor",
        extend: [m.temperature(), m.humidity(), m.battery()],
    },
    {
        zigbeeModel: ["SNZB-05", "CK-TLSR8656-SS5-01(7019)", "CK-TLSR8656-Z23SE11HW-01(7019)"],
        model: "SNZB-05",
        vendor: "eWeLink",
        description: "Zigbee water sensor",
        extend: [m.battery(), m.iasZoneAlarm({ zoneType: "water_leak", zoneAttributes: ["alarm_1", "battery_low"] })],
        whiteLabel: [
            {
                vendor: "eWeLink",
                model: "CK-TLSR8656-SS5-01(7019)",
                fingerprint: [
                    {
                        type: "EndDevice",
                        manufacturerName: "eWeLink",
                        modelID: "CK-TLSR8656-SS5-01(7019)",
                    },
                ],
            },
            {
                vendor: "eWeLink",
                model: "CK-TLSR8656-Z23SE11HW-01(7019)",
                fingerprint: [
                    {
                        type: "EndDevice",
                        manufacturerName: "eWeLink",
                        modelID: "CK-TLSR8656-Z23SE11HW-01(7019)",
                    },
                ],
            },
        ],
    },
    {
        zigbeeModel: ["NAS-AB03B3"],
        model: "NAS-AB03B3",
        vendor: "eWeLink",
        description: "Indoor sound and light alarm",
        extend: [
            ewelinkExtend.addCustomClusterSiren(),
            ewelinkExtend.sirenAlarm(),
            m.iasZoneAlarm({ zoneType: "generic", zoneAttributes: ["battery_low"] }),
            m.battery({ percentage: true, percentageReporting: true, percentageReportingConfig: { min: 3600, max: 7200, change: 2 } }),
            m.numeric({
                name: "alarm_duration",
                cluster: "customEwelinkSiren",
                attribute: "alarmSoundTime",
                entityCategory: "config",
                description: "Duration in seconds of the alarm",
                valueMin: 1,
                valueMax: 1800,
                unit: "s",
            }),
            m.numeric({
                name: "volume",
                cluster: "customEwelinkSiren",
                attribute: "alarmSoundLevel",
                entityCategory: "config",
                description: "Indoor siren volume level",
                valueMin: 0x00,
                valueMax: 0x0f,
                access: "ALL",
            }),
            m.enumLookup({
                name: "melody",
                lookup: { 1: 0x00, 2: 0x01, 3: 0x02, 4: 0x03, 5: 0x04, 6: 0x05, 7: 0x06, 8: 0x07, 9: 0x08, 10: 0x09, 11: 0x0a },
                cluster: "customEwelinkSiren",
                attribute: "alarmSoundMode",
                entityCategory: "config",
                description: "Alarm melody",
            }),
        ],
        ota: true,
    },
    {
        zigbeeModel: ["NAS-AB06B3"],
        model: "NAS-AB06B3",
        vendor: "eWeLink",
        description: "Outdoor sound and light alarm",
        extend: [
            ewelinkExtend.addCustomClusterSiren(),
            ewelinkExtend.sirenAlarm(),
            m.iasZoneAlarm({ zoneType: "generic", zoneAttributes: ["battery_low"] }),
            m.battery({ percentage: true, percentageReporting: true, percentageReportingConfig: { min: 3600, max: 7200, change: 2 } }),
            m.numeric({
                name: "alarm_duration",
                cluster: "customEwelinkSiren",
                attribute: "alarmSoundTime",
                entityCategory: "config",
                description: "Duration in seconds of the alarm",
                valueMin: 1,
                valueMax: 1800,
                unit: "s",
            }),
            m.enumLookup({
                name: "volume",
                lookup: { high: 0x03, medium: 0x02, low: 0x01 },
                cluster: "customEwelinkSiren",
                attribute: "alarmSoundLevel",
                entityCategory: "config",
                description: "Outdoor siren volume",
            }),
            m.enumLookup({
                name: "melody",
                lookup: { 1: 0x00, 2: 0x01, 3: 0x02 },
                cluster: "customEwelinkSiren",
                attribute: "alarmSoundMode",
                entityCategory: "config",
                description: "Alarm melody",
            }),
        ],
        ota: true,
    },
    {
        zigbeeModel: ["CK-MG22-JLDJ-01(7015)", "CK-MG22-Z310EE07DOOYA-01(7015)", "MYDY25Z-1", "Grandekor Smart Curtain Grandekor"],
        model: "CK-MG22-JLDJ-01(7015)",
        vendor: "eWeLink",
        whiteLabel: [
            { fingerprint: [{ modelID: "CK-MG22-Z310EE07DOOYA-01(7015)" }], vendor: "eWeLink", model: "CK-MG22-Z310EE07DOOYA-01(7015)" },
            { fingerprint: [{ modelID: "MYDY25Z-1" }], vendor: "eWeLink", model: "MYDY25Z-1" },
            { fingerprint: [{ modelID: "Grandekor Smart Curtain Grandekor" }], vendor: "eWeLink", model: "Grandekor Smart Curtain Grandekor" },
        ],
        description: "Dooya Curtain",
        extend: [
            m.deviceAddCustomCluster("customClusterEwelink", {
                name: "customClusterEwelink",
                ID: 0xef00,
                attributes: {},
                commands: {
                    protocolData: {
                        name: "protocolData",
                        ID: 0,
                        parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.LIST_UINT8 }],
                    },
                },
                commandsResponse: {},
            }),
            m.forcePowerSource({ powerSource: "Battery" }),
            ewelink_1.modernExtend.ewelinkBattery(),
            m.windowCovering({
                controls: ["lift"],
                configureReporting: false,
                coverMode: false,
                coverInverted: true,
            }),
            ewelink_1.modernExtend.ewelinkMotorReverse(),
            ewelink_1.modernExtend.ewelinkMotorMode("customClusterEwelink", "protocolData"),
            ewelink_1.modernExtend.ewelinkMotorClbByPosition("customClusterEwelink", "protocolData"),
            ewelink_1.modernExtend.ewelinkReportMotorInfo("customClusterEwelink"),
            ewelink_1.modernExtend.ewelinkMotorSpeed("customClusterEwelink", "protocolData", 0x00, 0x0e),
        ],
        configure: async (device, coordinatorEndpoint) => {
            const windowCoveringAttributes = [{ attribute: "currentPositionLiftPercentage", min: 0, max: 3600, change: 10 }];
            await m.setupAttributes(device, coordinatorEndpoint, "closuresWindowCovering", windowCoveringAttributes);
        },
        onEvent: async (event) => {
            if (event.type === "deviceInterview") {
                const endpoint = event.data.device.getEndpoint(1);
                // Query the maximum level supported for speed adjustment.
                await endpoint.command("customClusterEwelink", "protocolData", {
                    data: [0x02, 0x0e, 0x00],
                });
            }
        },
        ota: true,
    },
    {
        zigbeeModel: ["MYRX25Z-1"],
        model: "MYRX25Z-1",
        vendor: "eWeLink",
        description: "Reax Curtain",
        extend: [
            m.deviceAddCustomCluster("customClusterEwelink", {
                name: "customClusterEwelink",
                ID: 0xef00,
                attributes: {},
                commands: {
                    protocolData: {
                        name: "protocolData",
                        ID: 0,
                        parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.LIST_UINT8 }],
                    },
                },
                commandsResponse: {},
            }),
            m.forcePowerSource({ powerSource: "Battery" }),
            ewelink_1.modernExtend.ewelinkBattery(),
            m.windowCovering({
                controls: ["lift"],
                configureReporting: false,
                coverMode: false,
                coverInverted: true,
            }),
            ewelink_1.modernExtend.ewelinkMotorMode("customClusterEwelink", "protocolData"),
            ewelink_1.modernExtend.ewelinkMotorClbByPosition("customClusterEwelink", "protocolData"),
            ewelink_1.modernExtend.ewelinkReportMotorInfo("customClusterEwelink"),
            ewelink_1.modernExtend.ewelinkMotorSpeed("customClusterEwelink", "protocolData", 0x01, 0x03),
        ],
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ["customClusterEwelink"]);
            const windowCoveringAttributes = [{ attribute: "currentPositionLiftPercentage", min: 0, max: 3600, change: 10 }];
            await m.setupAttributes(device, coordinatorEndpoint, "closuresWindowCovering", windowCoveringAttributes);
        },
        ota: true,
    },
    {
        zigbeeModel: ["AM25B-1-25-ES-E-Z", "ZM25-EAZ", "AM25C-1-25-ES-E-Z"],
        model: "AM25B-1-25-ES-E-Z",
        vendor: "eWeLink",
        whiteLabel: [
            { fingerprint: [{ modelID: "ZM25-EAZ" }], vendor: "eWeLink", model: "ZM25-EAZ" },
            { fingerprint: [{ modelID: "AM25C-1-25-ES-E-Z" }], vendor: "eWeLink", model: "AM25C-1-25-ES-E-Z" },
        ],
        description: "AK Curtain",
        extend: [
            m.deviceAddCustomCluster("customClusterEwelink", {
                name: "customClusterEwelink",
                ID: 0xef00,
                attributes: {},
                commands: {
                    protocolData: {
                        name: "protocolData",
                        ID: 0,
                        parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.LIST_UINT8 }],
                    },
                },
                commandsResponse: {},
            }),
            m.forcePowerSource({ powerSource: "Battery" }),
            ewelink_1.modernExtend.ewelinkBattery(),
            m.windowCovering({
                controls: ["lift"],
                configureReporting: false,
                coverMode: false,
                coverInverted: true,
            }),
            ewelink_1.modernExtend.ewelinkMotorReverse(),
            ewelink_1.modernExtend.ewelinkMotorMode("customClusterEwelink", "protocolData"),
            ewelink_1.modernExtend.ewelinkMotorClbByPosition("customClusterEwelink", "protocolData"),
        ],
        configure: async (device, coordinatorEndpoint) => {
            const windowCoveringAttributes = [{ attribute: "currentPositionLiftPercentage", min: 0, max: 3600, change: 10 }];
            await m.setupAttributes(device, coordinatorEndpoint, "closuresWindowCovering", windowCoveringAttributes);
        },
        ota: true,
    },
    {
        zigbeeModel: ["CK-BL702-MWS-01(7016)"],
        model: "MG3-5RZ",
        vendor: "eWeLink",
        description: "Zigbee human presence radar (5.8 GHz)",
        extend: [
            m.occupancy({ reporting: false }),
            m.numeric({
                name: "occupied_to_unoccupied_delay",
                cluster: 0x0406,
                attribute: { ID: 0x0020, type: 0x21 },
                description: "Ultrasonic occupied → unoccupied delay (seconds)",
                valueMin: 60,
                valueMax: 65535,
            }),
            m.numeric({
                name: "unoccupied_to_occupied_delay",
                cluster: 0x0406,
                attribute: { ID: 0x0021, type: 0x21 },
                description: "Ultrasonic unoccupied → occupied delay (seconds)",
                valueMin: 0,
                valueMax: 65535,
            }),
            m.enumLookup({
                name: "occupancy_sensitivity",
                lookup: { low: 1, medium: 2, high: 3 },
                cluster: 0x0406,
                attribute: { ID: 0x0022, type: 0x20 },
                description: "Sensitivity of human presence detection",
            }),
        ],
        ota: false,
    },
    {
        zigbeeModel: ["CK-TLSR8656-SS5-01(7035)", "CK-TLSR8656-Z123SE22DY-01(7035)"],
        model: "CK-TLSR8656-SS5-01(7035)",
        vendor: "eWeLink",
        description: "Zigbee smoke alarm",
        ota: true,
        whiteLabel: [
            {
                model: "CK-TLSR8656-Z123SE22DY-01(7035)",
                vendor: "eWeLink",
                fingerprint: [
                    {
                        modelID: "CK-TLSR8656-Z123SE22DY-01(7035)",
                        manufacturerName: "eWeLink",
                    },
                ],
            },
        ],
        extend: [
            m.battery(),
            m.iasZoneAlarm({ zoneType: "smoke", zoneAttributes: ["alarm_1"] }),
            m.binary({
                name: "tamper",
                cluster: 0xfc11,
                attribute: { ID: 0x2000, type: 0x20 },
                description: "Tamper-proof status",
                valueOn: [true, 0x01],
                valueOff: [false, 0x00],
                zigbeeCommandOptions: { manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.SHENZHEN_COOLKIT_TECHNOLOGY_CO_LTD },
                access: "STATE_GET",
            }),
        ],
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ["ssIasZone"]);
            await endpoint.read("ssIasZone", ["zoneStatus", "zoneState", "iasCieAddr", "zoneId"]);
        },
    },
];
//# sourceMappingURL=ewelink.js.map