"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 exposes = __importStar(require("../lib/exposes"));
const e = exposes.presets;
const fzLocal = {
    qlwz_letv8key_switch: {
        cluster: "genMultistateInput",
        type: ["attributeReport", "readResponse"],
        convert: (model, msg, publish, options, meta) => {
            const buttonLookup = { 4: "up", 2: "down", 5: "left", 3: "right", 8: "center", 1: "back", 7: "play", 6: "voice" };
            const actionLookup = { 0: "hold", 1: "single", 2: "double", 3: "tripple" };
            const button = buttonLookup[msg.endpoint.ID];
            const action = actionLookup[msg.data.presentValue] || msg.data.presentValue;
            if (button) {
                return { action: `${action}_${button}` };
            }
        },
    },
};
exports.definitions = [
    {
        zigbeeModel: ["qlwz.letv8key.10"],
        model: "LeTV.8KEY",
        vendor: "LeTV",
        description: "8key switch",
        fromZigbee: [fzLocal.qlwz_letv8key_switch],
        exposes: [
            e.action([
                "hold_up",
                "single_up",
                "double_up",
                "tripple_up",
                "hold_down",
                "single_down",
                "double_down",
                "tripple_down",
                "hold_left",
                "single_left",
                "double_left",
                "tripple_left",
                "hold_right",
                "single_right",
                "double_right",
                "tripple_right",
                "hold_center",
                "single_center",
                "double_center",
                "tripple_center",
                "hold_back",
                "single_back",
                "double_back",
                "tripple_back",
                "hold_play",
                "single_play",
                "double_play",
                "tripple_play",
                "hold_voice",
                "single_voice",
                "double_voice",
                "tripple_voice",
            ]),
        ],
        toZigbee: [],
    },
];
//# sourceMappingURL=letv.js.map