]> git.basschouten.com Git - openhab-addons.git/blob
5f16f4b8a3a574c30d6f274f37eba3f80fbed1d4
[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"); // TBD
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
50     // List of configuration parameters
51
52     public static final String HOST = "ipAddress";
53     public static final String PORT = "port";
54     public static final String USER = "username";
55     public static final String PASS = "password";
56     public static final String STATUS_REFRESH_TIME = "statusrefresh";
57     public static final String ADD_SECONDARY_UNITS = "addSecondaryUnits";
58
59     // Unit handler properties
60
61     public static final String HANDLER_PROPERTIES_ID = "id";
62     public static final String HANDLER_PROPERTIES_NAME = "name";
63
64     // Connectivity options
65
66     public static final String CONNECTIVITY_KNX = "knx";
67     public static final String CONNECTIVITY_ZWAVE = "zwave";
68
69     // commands
70     public static final String SWITCH_STATUS_ON = "255";
71     public static final String SWITCH_STATUS_OFF = "0";
72
73     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>();
74
75     static {
76         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SWITCH);
77         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SHUTTER);
78         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_WALLCONTROLLER);
79         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_DIMMER);
80         // SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_ALARMSENSOR); // not implemented yet
81     }
82
83     public static final String TYPE_WALLCONTROLLER = "WallController";
84     public static final String TYPE_SWITCH = "Switch";
85     public static final String TYPE_SHUTTER = "shutter";
86     public static final String TYPE_DIMMER = "dimmer";
87     public static final String TYPE_ALARMSENSOR = "AlarmSensor";
88
89     public static final String[] SUPPORTED_TOUCHWAND_TYPES = { TYPE_WALLCONTROLLER, TYPE_SWITCH, TYPE_SHUTTER,
90             TYPE_DIMMER, TYPE_ALARMSENSOR };
91 }