package ru.kirillius.cooler.controller.API;

public enum DataType {
    NONE(0x0),
    TEMP(0x1),
    LEVEL(0x2),
    START_TEMP(0x3),
    STOP_TEMP(0x4),
    MAX_TEMP(0x5),
    MIN_LEVEL(0x6),
    MAX_LEVEL(0x7),
    UNKNOWN(0x255);

    private final byte value;

    DataType(int value) {
        this.value = (byte) value;
    }

    public static DataType getByValue(byte value) {
        for (DataType type : values()) {
            if (type.value == value) return type;
        }
        return UNKNOWN;
    }

    public byte getValue() {
        return value;
    }
}
