2 * Copyright (c) 2010-2020 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.velux.internal;
15 import java.util.Arrays;
16 import java.util.HashSet;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.core.thing.ThingTypeUID;
23 * The {@link VeluxBindingConstants} class defines common constants, which are
24 * used across the whole binding.
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}.
29 * This class contains the Thing identifications:
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>
39 * @author Guenther Schreiner - Initial contribution
42 public class VeluxBindingConstants {
44 /** Basic binding identification. */
45 public static final String BINDING_ID = "velux";
47 // Id of support bridge
49 * The Thing identification of the binding.
51 private static final String THING_VELUX_BINDING = "binding";
53 * The Thing identification of the <B>Velux</B> bridge.
55 private static final String THING_VELUX_BRIDGE = "klf200";
57 * The Thing identification of a scene defined on the <B>Velux</B> bridge.
59 private static final String THING_VELUX_SCENE = "scene";
61 * The Thing identification of a generic actuator defined on the <B>Velux</B> bridge.
63 private static final String THING_VELUX_ACTUATOR = "actuator";
65 * The Thing identification of a rollershutter defined on the <B>Velux</B> bridge.
67 private static final String THING_VELUX_ROLLERSHUTTER = "rollershutter";
69 * The Thing identification of a window defined on the <B>Velux</B> bridge.
71 private static final String THING_VELUX_WINDOW = "window";
73 * The Thing identification of a virtual shutter defined on the <B>Velux</B> bridge.
75 private static final String THING_VELUX_VSHUTTER = "vshutter";
77 // List of all Thing Type UIDs
78 public static final ThingTypeUID THING_TYPE_BINDING = new ThingTypeUID(BINDING_ID, THING_VELUX_BINDING);
80 // List of all Bridge Type UIDs
81 public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, THING_VELUX_BRIDGE);
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);
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));
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));
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);
103 // *** List of all Channel ids ***
105 // List of all binding channel ids
107 /** Channel identifier describing the current Binding State. */
108 public static final String CHANNEL_BINDING_INFORMATION = "information";
110 // List of all bridge channel ids
112 /** Channel/Property identifier describing the current Bridge State. */
113 public static final String CHANNEL_BRIDGE_STATUS = "status";
114 public static final String CHANNEL_BRIDGE_RELOAD = "reload";
115 public static final String CHANNEL_BRIDGE_DOWNTIME = "downtime";
116 public static final String CHANNEL_BRIDGE_DO_DETECTION = "doDetection";
118 public static final String PROPERTY_BRIDGE_TIMESTAMP_SUCCESS = "connectionSuccess";
119 public static final String PROPERTY_BRIDGE_TIMESTAMP_ATTEMPT = "connectionAttempt";
120 public static final String PROPERTY_BRIDGE_FIRMWARE = "firmware";
121 public static final String PROPERTY_BRIDGE_ADDRESS = "address";
122 public static final String PROPERTY_BRIDGE_SUBNETMASK = "subnetMask";
123 public static final String PROPERTY_BRIDGE_DEFAULTGW = "defaultGW";
124 public static final String PROPERTY_BRIDGE_DHCP = "DHCP";
125 public static final String PROPERTY_BRIDGE_WLANSSID = "WLANSSID";
126 public static final String PROPERTY_BRIDGE_WLANPASSWORD = "WLANPassword";
128 public static final String PROPERTY_BRIDGE_CHECK = "check";
129 public static final String PROPERTY_BRIDGE_PRODUCTS = "products";
130 public static final String PROPERTY_BRIDGE_SCENES = "scenes";
132 // List of all scene channel ids
133 public static final String CHANNEL_SCENE_ACTION = "action";
134 public static final String CHANNEL_SCENE_SILENTMODE = "silentMode";
136 // List of all actuator channel ids
137 public static final String CHANNEL_ACTUATOR_POSITION = "position";
138 public static final String CHANNEL_ACTUATOR_STATE = "state";
139 public static final String CHANNEL_ACTUATOR_SILENTMODE = "silentMode";
140 public static final String CHANNEL_ACTUATOR_LIMIT_MINIMUM = "limitMinimum";
141 public static final String CHANNEL_ACTUATOR_LIMIT_MAXIMUM = "limitMaximum";
143 // List of all virtual shutter channel ids
144 public static final String CHANNEL_VSHUTTER_POSITION = "vposition";
146 // Helper definitions
147 public static final String BINDING_VALUES_SEPARATOR = ",";
148 public static final String OUTPUT_VALUE_SEPARATOR = ",";
149 public static final String UNKNOWN = "unknown";
151 // Critical issues to be reported will use the following message
152 public static final String LOGGING_CONTACT = "Please report to maintainer: ";
154 public static final String UNKNOWN_THING_TYPE_ID = "FAILED";
155 public static final String UNKNOWN_IP_ADDRESS = "xxx.xxx.xxx.xxx";
157 public static final String BRIDGE_THING_TYPE_UID = THING_TYPE_BRIDGE.toString();