]> git.basschouten.com Git - openhab-addons.git/blob
c5a8f38d61a5686b0fb270e7e6e77b08e5a59f76
[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.irtrans.internal;
14
15 import org.openhab.core.thing.ThingTypeUID;
16
17 /**
18  * The {@link IRtransBindingConstants} contains constants used by the IRtrans
19  * handler classes
20  *
21  * @author Karel Goderis - Initial contribution
22  *
23  **/
24 public class IRtransBindingConstants {
25
26     public static final String BINDING_ID = "irtrans";
27
28     // List of all Thing Type UIDs
29     public static final ThingTypeUID THING_TYPE_ETHERNET_BRIDGE = new ThingTypeUID(BINDING_ID, "ethernet");
30     public static final ThingTypeUID THING_TYPE_BLASTER = new ThingTypeUID(BINDING_ID, "blaster");
31
32     // List of all Channel ids
33     public static final String CHANNEL_IO = "io";
34
35     // List of all Channel types
36     public static final String BLASTER_CHANNEL_TYPE = "blaster";
37     public static final String RECEIVER_CHANNEL_TYPE = "receiver";
38
39     // List of possible leds on an IRtrans transceiver
40     public enum Led {
41         DEFAULT("D"),
42         INTERNAL("I"),
43         EXTERNAL("E"),
44         ALL("B"),
45         ONE("1"),
46         TWO("2"),
47         THREE("3"),
48         FOUR("4"),
49         FIVE("5"),
50         SIX("6"),
51         SEVEN("7"),
52         EIGHT("8");
53
54         private final String text;
55
56         private Led(final String text) {
57             this.text = text;
58         }
59
60         @Override
61         public String toString() {
62             return text;
63         }
64
65         public static Led get(String valueSelectorText) throws IllegalArgumentException {
66             for (Led c : Led.values()) {
67                 if (c.text.equals(valueSelectorText)) {
68                     return c;
69                 }
70             }
71
72             throw new IllegalArgumentException("Not valid value selector");
73         }
74     }
75 }