package com.fuyuanshen.web.enums;

/**
 * @author: 默苍璃
 * @date: 2025-08-0114:14
 */
public enum InstructType6170 {

    EQUIPMENT_REPORTING(0, "设备启动"),
    LIGHT_MODE(1, "灯光模式"),
    /**
     * 设备信息
     * 单位/姓名/职位
     */
    UNIT_INFO(2, "设备信息"),
    BOOT_IMAGE(3, "开机图片"),
    LASER_LIGHT(4, "激光灯"),
    BRIGHTNESS(5, "亮度调节"),
    LOCATION_DATA(11, "定位数据"),


    UNKNOWN(-1, "未知操作");

    private final int code;
    private final String description;

    InstructType6170(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static InstructType6170 fromCode(int code) {
        for (InstructType6170 type : values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        // throw new IllegalArgumentException("未知的指令类型代码: " + code);
        return UNKNOWN;
    }

}
