]> git.basschouten.com Git - openhab-addons.git/blob
6bab5b1510d423a8c66dbfc445bdef5bbd7c50c3
[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.miio.internal.robot;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * List of Errors
19  *
20  * @author Marcel Verpaalen - Initial contribution
21  */
22 @NonNullByDefault
23 public enum FanModeType {
24
25     SILENT(38, "Silent"),
26     STANDARD(60, "Standard"),
27     TURBO(75, "Turbo"),
28     POWER(77, "Power"),
29     FULL(90, "Full"),
30     MAX(100, "Max"),
31     QUIET(101, "Quiet"),
32     BALANCED(102, "Balanced"),
33     TURBO2(103, "Turbo"),
34     MAX2(104, "Max"),
35     MOB(105, "Mob"),
36     CUSTOM(-1, "Custom");
37
38     private final int id;
39     private final String description;
40
41     FanModeType(int id, String description) {
42         this.id = id;
43         this.description = description;
44     }
45
46     public int getId() {
47         return id;
48     }
49
50     public static FanModeType getType(int value) {
51         for (FanModeType st : FanModeType.values()) {
52             if (st.getId() == value) {
53                 return st;
54             }
55         }
56         return CUSTOM;
57     }
58
59     public String getDescription() {
60         return description;
61     }
62
63     @Override
64     public String toString() {
65         return "Status " + Integer.toString(id) + ": " + description;
66     }
67 }