]> git.basschouten.com Git - openhab-addons.git/blob
b0c6df5d4de935ff3c309c793c995eca08994dbe
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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.touchwand.internal;
14
15 import java.util.HashSet;
16 import java.util.Set;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.core.thing.ThingTypeUID;
20
21 /**
22  * The {@link TouchWandBindingConstants} class defines common constants, which are
23  * used across the whole binding.
24  *
25  * @author Roie Geron - Initial contribution
26  */
27 @NonNullByDefault
28 public class TouchWandBindingConstants {
29
30     public static final String BINDING_ID = "touchwand";
31     public static final String DISCOVERY_THREAD_ID = "OH-binding-touchwand-discovery";
32
33     // List of all Thing Type UIDs
34     public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
35     public static final ThingTypeUID THING_TYPE_SWITCH = new ThingTypeUID(BINDING_ID, "switch");
36     public static final ThingTypeUID THING_TYPE_SHUTTER = new ThingTypeUID(BINDING_ID, "shutter");
37     public static final ThingTypeUID THING_TYPE_WALLCONTROLLER = new ThingTypeUID(BINDING_ID, "wallcontroller");
38     public static final ThingTypeUID THING_TYPE_DIMMER = new ThingTypeUID(BINDING_ID, "dimmer");
39     public static final ThingTypeUID THING_TYPE_ALARMSENSOR = new ThingTypeUID(BINDING_ID, "alarmsensor");
40
41     // List of all Channel ids
42     public static final String CHANNEL_SWITCH = "switch";
43     public static final String CHANNEL_SHUTTER = "shutter";
44     public static final String CHANNEL_DIMMER = "brightness";
45     public static final String CHANNEL_ALARM = "alarm";
46     public static final String CHANNEL_WALLCONTROLLER_ACTION = "wallaction";
47     public static final String CHANNEL_BATTERY_LEVEL = "battery_level";
48     public static final String CHANNEL_BATTERY_LOW = "battery_low";
49     public static final String CHANNEL_LEAK = "leak";
50     public static final String CHANNEL_MOTION = "motion";
51     public static final String CHANNEL_ILLUMINATION = "illumination";
52     public static final String CHANNEL_DOORWINDOW = "isOpen";
53     public static final String CHANNEL_TEMPERATURE = "temperature";
54
55     // List of configuration parameters
56
57     public static final String HOST = "ipAddress";
58     public static final String PORT = "port";
59     public static final String USER = "username";
60     public static final String PASS = "password";
61     public static final String STATUS_REFRESH_TIME = "statusrefresh";
62     public static final String ADD_SECONDARY_UNITS = "addSecondaryUnits";
63
64     // Unit handler properties
65
66     public static final String HANDLER_PROPERTIES_ID = "id";
67     public static final String HANDLER_PROPERTIES_NAME = "name";
68
69     // Connectivity options
70
71     public static final String CONNECTIVITY_KNX = "knx";
72     public static final String CONNECTIVITY_ZWAVE = "zwave";
73
74     // commands
75     public static final String SWITCH_STATUS_ON = "255";
76     public static final String SWITCH_STATUS_OFF = "0";
77
78     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>();
79
80     static {
81         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SWITCH);
82         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SHUTTER);
83         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_WALLCONTROLLER);
84         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_DIMMER);
85         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_ALARMSENSOR);
86     }
87
88     public static final String TYPE_WALLCONTROLLER = "WallController";
89     public static final String TYPE_SWITCH = "Switch";
90     public static final String TYPE_SHUTTER = "shutter";
91     public static final String TYPE_DIMMER = "dimmer";
92     public static final String TYPE_ALARMSENSOR = "AlarmSensor";
93     public static final String TYPE_UNKNOWN = "unknown";
94
95     public static final int SENSOR_TYPE_TEMPERATURE = 1;
96     public static final int SENSOR_TYPE_LUMINANCE = 3;
97     public static final int SENSOR_TYPE_LEAK = 6;
98     public static final int SENSOR_TYPE_DOOR_WINDOW = 10;
99     public static final int SENSOR_TYPE_MOTION = 12;
100
101     public static final String[] SUPPORTED_TOUCHWAND_TYPES = { TYPE_WALLCONTROLLER, TYPE_SWITCH, TYPE_SHUTTER,
102             TYPE_DIMMER, TYPE_ALARMSENSOR };
103 }