]> git.basschouten.com Git - openhab-addons.git/blob
b926f8d058d2274dc4af73f5e14fc51b0c148e74
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.millheat.internal.model;
14
15 /**
16  * The {@link ModeType} represents a type of mode the user can set in the app.
17  *
18  * @author Arne Seime - Initial contribution
19  */
20 public enum ModeType {
21     ALWAYSHOME(-1),
22     COMFORT(1),
23     SLEEP(2),
24     AWAY(3),
25     VACATION(4),
26     OFF(5);
27
28     public static ModeType valueOf(final int modeVal) {
29         for (final ModeType mode : ModeType.values()) {
30             if (mode.value == modeVal) {
31                 return mode;
32             }
33         }
34         return null;
35     }
36
37     private final int value;
38
39     ModeType(final int value) {
40         this.value = value;
41     }
42
43     public int getValue() {
44         return value;
45     }
46 }