2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.venstarthermostat.internal.dto;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The {@link VenstarSystemMode} represents the value of the system mode returned
21 * @author William Welliver - Initial contribution
24 public enum VenstarSystemMode {
26 HEAT(1, "heat", "Heat"),
27 COOL(2, "cool", "Cool"),
28 AUTO(3, "auto", "Auto");
32 private String friendlyName;
34 VenstarSystemMode(int mode, String name, String friendlyName) {
37 this.friendlyName = friendlyName;
44 public String modeName() {
48 public String friendlyName() {
52 public static VenstarSystemMode fromInt(int mode) throws IllegalArgumentException {
53 for (VenstarSystemMode sm : values()) {
54 if (sm.mode == mode) {
59 throw (new IllegalArgumentException("Invalid system mode " + mode));