package de.death.yeelight.model;

public enum MODE {
	COLOR_MODE(1), COLOR_TEMPERATURE(2), HSV(3);

	int code;

	private MODE(int code) {
		this.code = code;
	}

	public int getCode() {
		return code;
	}

	public static MODE getEnumNameFromCode(int code) {
		MODE[] values = MODE.values();
		for (MODE eachValue : values) {
			if (eachValue.getCode() == code) {
				return eachValue;
			}
		}
		throw new RuntimeException("Unknown Color Mode");
	}

}
