]> git.basschouten.com Git - openhab-addons.git/blob
5539df99cafa978c80659b60db2a2c37cd93ca74
[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.velux.internal;
14
15 import java.util.Arrays;
16 import java.util.HashSet;
17 import java.util.Set;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.core.thing.ThingTypeUID;
21
22 /**
23  * The {@link VeluxBindingConstants} class defines common constants, which are
24  * used across the whole binding.
25  * <P>
26  * For an in-depth view of the available Item types with description of parameters, take a look onto
27  * {@link org.openhab.binding.velux.internal.VeluxItemType VeluxItemType}.
28  * </P>
29  * This class contains the Thing identifications:
30  * <UL>
31  * <LI>{@link #THING_VELUX_BRIDGE} for the bridge itself,</LI>
32  * <LI>{@link #THING_VELUX_SCENE} for the scenes summarizing a set of actuator states,</LI>
33  * <LI>{@link #THING_VELUX_ACTUATOR} for the general actuators identified on the bridge,</LI>
34  * <LI>{@link #THING_VELUX_ROLLERSHUTTER} for the rollershutters identified on the bridge,</LI>
35  * <LI>{@link #THING_VELUX_WINDOW} for the windows identified on the bridge.</LI>
36  * <LI>{@link #THING_VELUX_VSHUTTER} for the virtual shutters defined in the configuration</LI>
37  * </UL>
38  *
39  * @author Guenther Schreiner - Initial contribution
40  */
41 @NonNullByDefault
42 public class VeluxBindingConstants {
43
44     /** Basic binding identification. */
45     public static final String BINDING_ID = "velux";
46
47     // Id of support bridge
48     /**
49      * The Thing identification of the binding.
50      */
51     private static final String THING_VELUX_BINDING = "binding";
52     /**
53      * The Thing identification of the <B>Velux</B> bridge.
54      */
55     private static final String THING_VELUX_BRIDGE = "klf200";
56     /**
57      * The Thing identification of a scene defined on the <B>Velux</B> bridge.
58      */
59     private static final String THING_VELUX_SCENE = "scene";
60     /**
61      * The Thing identification of a generic actuator defined on the <B>Velux</B> bridge.
62      */
63     private static final String THING_VELUX_ACTUATOR = "actuator";
64     /**
65      * The Thing identification of a rollershutter defined on the <B>Velux</B> bridge.
66      */
67     private static final String THING_VELUX_ROLLERSHUTTER = "rollershutter";
68     /**
69      * The Thing identification of a window defined on the <B>Velux</B> bridge.
70      */
71     private static final String THING_VELUX_WINDOW = "window";
72     /**
73      * The Thing identification of a virtual shutter defined on the <B>Velux</B> bridge.
74      */
75     private static final String THING_VELUX_VSHUTTER = "vshutter";
76
77     // List of all Thing Type UIDs
78     public static final ThingTypeUID THING_TYPE_BINDING = new ThingTypeUID(BINDING_ID, THING_VELUX_BINDING);
79
80     // List of all Bridge Type UIDs
81     public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, THING_VELUX_BRIDGE);
82
83     // List of all Thing Type UIDs beyond the bridge(s)
84     public static final ThingTypeUID THING_TYPE_VELUX_SCENE = new ThingTypeUID(BINDING_ID, THING_VELUX_SCENE);
85     public static final ThingTypeUID THING_TYPE_VELUX_ACTUATOR = new ThingTypeUID(BINDING_ID, THING_VELUX_ACTUATOR);
86     public static final ThingTypeUID THING_TYPE_VELUX_ROLLERSHUTTER = new ThingTypeUID(BINDING_ID,
87             THING_VELUX_ROLLERSHUTTER);
88     public static final ThingTypeUID THING_TYPE_VELUX_WINDOW = new ThingTypeUID(BINDING_ID, THING_VELUX_WINDOW);
89     public static final ThingTypeUID THING_TYPE_VELUX_VSHUTTER = new ThingTypeUID(BINDING_ID, THING_VELUX_VSHUTTER);
90
91     // Definitions of different set of Things
92     public static final Set<ThingTypeUID> SUPPORTED_THINGS_BINDING = new HashSet<>(Arrays.asList(THING_TYPE_BINDING));
93     public static final Set<ThingTypeUID> SUPPORTED_THINGS_BRIDGE = new HashSet<>(Arrays.asList(THING_TYPE_BRIDGE));
94
95     public static final Set<ThingTypeUID> SUPPORTED_THINGS_ITEMS = new HashSet<>(
96             Arrays.asList(THING_TYPE_VELUX_SCENE, THING_TYPE_VELUX_ACTUATOR, THING_TYPE_VELUX_ROLLERSHUTTER,
97                     THING_TYPE_VELUX_WINDOW, THING_TYPE_VELUX_VSHUTTER));
98
99     public static final Set<ThingTypeUID> DISCOVERABLE_THINGS = Set.of(THING_TYPE_VELUX_SCENE,
100             THING_TYPE_VELUX_ACTUATOR, THING_TYPE_VELUX_ROLLERSHUTTER, THING_TYPE_VELUX_WINDOW,
101             THING_TYPE_VELUX_VSHUTTER, THING_TYPE_BINDING, THING_TYPE_BRIDGE);
102
103     public static final Set<ThingTypeUID> ACTUATOR_THINGS = Set.of(THING_TYPE_VELUX_ACTUATOR,
104             THING_TYPE_VELUX_ROLLERSHUTTER, THING_TYPE_VELUX_WINDOW);
105
106     // *** List of all Channel ids ***
107
108     // List of all binding channel ids
109
110     /** Channel identifier describing the current Binding State. */
111     public static final String CHANNEL_BINDING_INFORMATION = "information";
112
113     // List of all bridge channel ids
114
115     /** Channel/Property identifier describing the current Bridge State. */
116     public static final String CHANNEL_BRIDGE_STATUS = "status";
117     public static final String CHANNEL_BRIDGE_RELOAD = "reload";
118     public static final String CHANNEL_BRIDGE_DOWNTIME = "downtime";
119     public static final String CHANNEL_BRIDGE_DO_DETECTION = "doDetection";
120
121     public static final String PROPERTY_BRIDGE_TIMESTAMP_SUCCESS = "connectionSuccess";
122     public static final String PROPERTY_BRIDGE_TIMESTAMP_ATTEMPT = "connectionAttempt";
123     public static final String PROPERTY_BRIDGE_FIRMWARE = "firmware";
124     public static final String PROPERTY_BRIDGE_ADDRESS = "address";
125     public static final String PROPERTY_BRIDGE_SUBNETMASK = "subnetMask";
126     public static final String PROPERTY_BRIDGE_DEFAULTGW = "defaultGW";
127     public static final String PROPERTY_BRIDGE_DHCP = "DHCP";
128     public static final String PROPERTY_BRIDGE_WLANSSID = "WLANSSID";
129     public static final String PROPERTY_BRIDGE_WLANPASSWORD = "WLANPassword";
130
131     public static final String PROPERTY_BRIDGE_CHECK = "check";
132     public static final String PROPERTY_BRIDGE_PRODUCTS = "products";
133     public static final String PROPERTY_BRIDGE_SCENES = "scenes";
134
135     // List of all scene channel ids
136     public static final String CHANNEL_SCENE_ACTION = "action";
137     public static final String CHANNEL_SCENE_SILENTMODE = "silentMode";
138
139     // List of all actuator channel ids
140     public static final String CHANNEL_ACTUATOR_POSITION = "position";
141     public static final String CHANNEL_ACTUATOR_STATE = "state";
142     public static final String CHANNEL_ACTUATOR_SILENTMODE = "silentMode";
143     public static final String CHANNEL_ACTUATOR_LIMIT_MINIMUM = "limitMinimum";
144     public static final String CHANNEL_ACTUATOR_LIMIT_MAXIMUM = "limitMaximum";
145     public static final String CHANNEL_VANE_POSITION = "vanePosition";
146
147     // List of all virtual shutter channel ids
148     public static final String CHANNEL_VSHUTTER_POSITION = "vposition";
149
150     public static final Set<String> POSITION_CHANNELS = Set.of(CHANNEL_ACTUATOR_POSITION, CHANNEL_ACTUATOR_STATE,
151             CHANNEL_VANE_POSITION, CHANNEL_VSHUTTER_POSITION);
152
153     // Helper definitions
154     public static final String BINDING_VALUES_SEPARATOR = ",";
155     public static final String OUTPUT_VALUE_SEPARATOR = ",";
156     public static final String UNKNOWN = "unknown";
157
158     // Critical issues to be reported will use the following message
159     public static final String LOGGING_CONTACT = "Please report to maintainer: ";
160
161     public static final String UNKNOWN_THING_TYPE_ID = "FAILED";
162     public static final String UNKNOWN_IP_ADDRESS = "xxx.xxx.xxx.xxx";
163 }