package com.bonus.canteen.core.kitchen.domain.constants;

public enum DeviceSensorResultEnum {
    NORMAL(1, "正常"),
    TEMPERATURE_HIGH(2, "温度过高"),
    TEMPERATURE_LOW(3, "温度过低"),
    HUMIDITY_HIGH(4, "湿度过高"),
    HUMIDITY_LOW(5, "湿度过低"),
    SMOKE_HIGH(6, "烟雾浓度高");

    private final Integer key;
    private final String desc;

    private DeviceSensorResultEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }
    public Integer getKey() {
        return this.key;
    }

    public String getDesc() {
        return this.desc;
    }

    public static String getDescByKey(Integer targetKey) {
        for (DeviceSensorResultEnum sensorResultEnum : DeviceSensorResultEnum.values()) {
            if (sensorResultEnum.getKey().equals(targetKey)) {
                return sensorResultEnum.getDesc();
            }
        }
        return "";
    }
}
