]> git.basschouten.com Git - openhab-addons.git/blob
ac94180a73b5fd90639b6b4eaf197d8b9261682c
[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.globalcache.internal;
14
15 import java.util.Collections;
16 import java.util.Set;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
22
23 /**
24  * The {@link GlobalCacheBindingConstants} class defines common constants that are
25  * used by the globalcache binding.
26  *
27  * @author Mark Hilbush - Initial contribution
28  */
29 @NonNullByDefault
30 public class GlobalCacheBindingConstants {
31
32     public static final String BINDING_ID = "globalcache";
33
34     /*
35      * GlobalCache thing definitions
36      */
37     // GlobalCache Thing Type UIDs -- IR = Infrared, CC = Contact Closure, SL = Serial
38     public static final ThingTypeUID THING_TYPE_ITACH_IR = new ThingTypeUID(BINDING_ID, "itachIR");
39     public static final ThingTypeUID THING_TYPE_ITACH_CC = new ThingTypeUID(BINDING_ID, "itachCC");
40     public static final ThingTypeUID THING_TYPE_ITACH_SL = new ThingTypeUID(BINDING_ID, "itachSL");
41     public static final ThingTypeUID THING_TYPE_ITACH_FLEX = new ThingTypeUID(BINDING_ID, "itachFlex");
42     public static final ThingTypeUID THING_TYPE_GC_100_06 = new ThingTypeUID(BINDING_ID, "gc100_06");
43     public static final ThingTypeUID THING_TYPE_GC_100_12 = new ThingTypeUID(BINDING_ID, "gc100_12");
44     public static final ThingTypeUID THING_TYPE_ZMOTE = new ThingTypeUID(BINDING_ID, "zmote");
45
46     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
47             Stream.of(THING_TYPE_ITACH_IR, THING_TYPE_ITACH_CC, THING_TYPE_ITACH_SL, THING_TYPE_ITACH_FLEX,
48                     THING_TYPE_GC_100_06, THING_TYPE_GC_100_12, THING_TYPE_ZMOTE).collect(Collectors.toSet()));
49
50     // GlobalCache-specific thing properties
51     public static final String THING_PROPERTY_UID = "uid";
52     public static final String THING_PROPERTY_MAC = "macAddress";
53
54     /*
55      * GlobalCache thing configuration items
56      */
57     // Network address of the device
58     public static final String THING_PROPERTY_IP = "ipAddress";
59
60     // MAP file containing mappings from command to IR and SL string
61     public static final String THING_CONFIG_MAP_FILENAME = "mapFilename";
62
63     // Flex "Current Active Cable"
64     public static final String THING_CONFIG_ACTIVECABLE = "activeCable";
65
66     public static final String ACTIVE_CABLE_INFRARED = "FLEX_INFRARED";
67     public static final String ACTIVE_CABLE_SERIAL = "FLEX_SERIAL";
68     public static final String ACTIVE_CABLE_RELAY = "FLEX_RELAY";
69
70     // Serial readers
71     public static final String CONFIG_ENABLE_TWO_WAY_PORT_1 = "enableTwoWay1";
72     public static final String CONFIG_END_OF_MESSAGE_DELIMITER_PORT_1 = "eomDelimiter1";
73     public static final String CONFIG_ENABLE_TWO_WAY_PORT_2 = "enableTwoWay2";
74     public static final String CONFIG_END_OF_MESSAGE_DELIMITER_PORT_2 = "eomDelimiter2";
75
76     // Indicates TCP connection over which the command will be sent
77     public enum CommandType {
78         COMMAND,
79         SERIAL1,
80         SERIAL2
81     }
82
83     /*
84      * Channel constants
85      */
86     // GlobalCache Channel Types
87     public static final String CHANNEL_TYPE_IR = "channel-type-ir";
88     public static final String CHANNEL_TYPE_CC = "channel-type-cc";
89     public static final String CHANNEL_TYPE_SL = "channel-type-sl";
90     public static final String CHANNEL_TYPE_SL_DIRECT = "channel-type-sl-direct";
91     public static final String CHANNEL_TYPE_SL_FEEDBACK = "channel-type-sl-receive";
92
93     // Channels for handing feedback from serial devices
94     public static final String CHANNEL_SL_M1_RECEIVE = "sl-m1#c1-receive";
95     public static final String CHANNEL_SL_M2_RECEIVE = "sl-m2#c1-receive";
96
97     // Channel properties that are used to specify module number and connector number
98     public static final String CHANNEL_PROPERTY_MODULE = "module";
99     public static final String CHANNEL_PROPERTY_CONNECTOR = "connector";
100
101     // List of iTach model strings returned in the device discovery beacon
102     public static final String GC_MODEL_ITACH = "iTach";
103     public static final String GC_MODEL_ITACHIP2IR = "iTachIP2IR";
104     public static final String GC_MODEL_ITACHWF2IR = "iTachWF2IR";
105     public static final String GC_MODEL_ITACHIP2CC = "iTachIP2CC";
106     public static final String GC_MODEL_ITACHWF2CC = "iTachWF2CC";
107     public static final String GC_MODEL_ITACHIP2SL = "iTachIP2SL";
108     public static final String GC_MODEL_ITACHWF2SL = "iTachWF2SL";
109     public static final String GC_MODEL_ITACHFLEXETH = "iTachFlexEthernet";
110     public static final String GC_MODEL_ITACHFLEXETHPOE = "iTachFlexEthernetPoE";
111     public static final String GC_MODEL_ITACHFLEXWIFI = "iTachFlexWiFi";
112
113     // List of GC-100 model strings returned in the device discovery beacon
114     public static final String GC_MODEL_GC_100 = "GC-100";
115     public static final String GC_MODEL_GC_100_06 = "GC-100-06";
116     public static final String GC_MODEL_GC_100_12 = "GC-100-12";
117
118     // List of Zmote strings returned in the device discovery beacon
119     public static final String GC_MODEL_ZMOTE = "ZV-2";
120 }