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.digitalstrom.internal.lib.climate.constants;
16 * The {@link OperationModes} contains all digitalSTROM heating operation states.
18 * @author Michael Ochel - Initial contribution
19 * @author Matthias Siegele - Initial contribution
21 public enum OperationModes {
23 OFF((short) 0, "Off"),
24 COMFORT((short) 1, "Comfort"),
25 ECONEMY((short) 2, "Econemy"),
26 NOT_USED((short) 3, "NotUsed"),
27 NIGHT((short) 4, "Night"),
28 HOLLYDAY((short) 5, "Holliday"),
29 COOLING((short) 6, "Cooling"),
30 COOLING_OFF((short) 7, "CoolingOff");
32 private final Short id;
33 private final String key;
35 private static final OperationModes[] OPERATION_MODES = new OperationModes[OperationModes.values().length];
38 for (OperationModes operationMode : OperationModes.values()) {
39 OPERATION_MODES[operationMode.id] = operationMode;
44 * Returns the {@link OperationModes} of the given operation mode id.
46 * @param id of the operation mode
47 * @return operation mode
49 public static OperationModes getOperationMode(short id) {
51 return OPERATION_MODES[id];
52 } catch (IndexOutOfBoundsException e) {
57 private OperationModes(short id, String key) {
63 * Returns the key of the operation mode.
67 public String getKey() {
72 * Returns the ID of the operation mode.
76 public Short getID() {