package cn.hanghui.outapi.platform.tenant.entity.enums;

import cn.hanghui.outapi.platform.common.utils.Preconditions;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum HhFaceHardwareConfigEnum {

    USE_SERIAL_PORT("USE_SERIAL_PORT","开门信号"),
    RELAY_OPEN_MODEL("RELAY_OPEN_MODEL","继电器开门模式"),
    LIGHT_MODE("LIGHT_MODE","补光灯"),
    LED_BRIGHTNESS("LED_BRIGHTNESS","补光灯亮度(0~200)"),
            ;

    private String code;
    private String desc;

    public static HhFaceHardwareConfigEnum findByCode(String code) {
        if (Preconditions.isBlank(code)) {
            return null;
        }
        for (HhFaceHardwareConfigEnum enumObject : values()) {
            if (enumObject.code.equals(code)) {
                return enumObject;
            }
        }
        return null;
    }

    }
