package ru.kirillius.cooler.controller.API;

public enum ActionType {
    SAVE(0x0),
    PING(0x1),
    REBOOT(0x2),
    READ(0x3),
    WRITE(0x4),
    ERROR(0x5),
    UNKNOWN(0x255);

    private final byte value;

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

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

    public byte getValue() {
        return value;
    }
}
