]> git.basschouten.com Git - openhab-addons.git/blob
3319dfb1ad7fa3158304031be18c6ee8c76ddfeb
[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.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     public static final ThingTypeUID THING_TYPE_BSENSOR = new ThingTypeUID(BINDING_ID, "bsensor");
41     public static final ThingTypeUID THING_TYPE_THERMOSTAT = new ThingTypeUID(BINDING_ID, "thermostat");
42
43     // List of all Channel ids
44     public static final String CHANNEL_SWITCH = "switch";
45     public static final String CHANNEL_SHUTTER = "shutter";
46     public static final String CHANNEL_DIMMER = "brightness";
47     public static final String CHANNEL_ALARM = "alarm";
48     public static final String CHANNEL_WALLCONTROLLER_ACTION = "wallaction";
49     public static final String CHANNEL_BATTERY_LEVEL = "battery_level";
50     public static final String CHANNEL_BATTERY_LOW = "battery_low";
51     public static final String CHANNEL_LEAK = "leak";
52     public static final String CHANNEL_MOTION = "motion";
53     public static final String CHANNEL_ILLUMINATION = "illumination";
54     public static final String CHANNEL_DOORWINDOW = "isOpen";
55     public static final String CHANNEL_TEMPERATURE = "temperature";
56     public static final String CHANNEL_THERMOSTAT_STATE = "state";
57     public static final String CHANNEL_THERMOSTAT_TARGET_TEMPERATURE = "targetTemperature";
58     public static final String CHANNEL_THERMOSTAT_ROOM_TEMPERATURE = "roomTemperature";
59     public static final String CHANNEL_THERMOSTAT_MODE = "mode";
60     public static final String CHANNEL_THERMOSTAT_FAN_LEVEL = "fanLevel";
61     public static final String CHANNEL_SMOKE = "smoke";
62
63     // List of configuration parameters
64
65     public static final String HOST = "ipAddress";
66     public static final String PORT = "port";
67     public static final String USER = "username";
68     public static final String PASS = "password";
69     public static final String STATUS_REFRESH_TIME = "statusrefresh";
70     public static final String ADD_SECONDARY_UNITS = "addSecondaryUnits";
71
72     // Unit handler properties
73
74     public static final String HANDLER_PROPERTIES_ID = "id";
75     public static final String HANDLER_PROPERTIES_NAME = "name";
76
77     // Connectivity options
78
79     public static final String CONNECTIVITY_KNX = "knx";
80     public static final String CONNECTIVITY_ZWAVE = "zwave";
81     public static final String CONNECTIVITY_RISCO = "risco";
82     public static final String CONNECTIVITY_PIMA = "pima";
83     public static final String CONNECTIVITY_ACWAND = "acwand";
84
85     // commands
86
87     public static final String SWITCH_STATUS_ON = "255";
88     public static final String SWITCH_STATUS_OFF = "0";
89
90     // thermostat commands
91     public static final String THERMOSTAT_STATE_ON = "1";
92     public static final String THERMOSTAT_STATE_OFF = "0";
93     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>();
94
95     static {
96         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SWITCH);
97         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_SHUTTER);
98         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_WALLCONTROLLER);
99         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_DIMMER);
100         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_ALARMSENSOR);
101         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_BSENSOR);
102         SUPPORTED_THING_TYPES_UIDS.add(THING_TYPE_THERMOSTAT);
103     }
104
105     public static final String TYPE_WALLCONTROLLER = "WallController";
106     public static final String TYPE_SWITCH = "Switch";
107     public static final String TYPE_SHUTTER = "shutter";
108     public static final String TYPE_DIMMER = "dimmer";
109     public static final String TYPE_ALARMSENSOR = "AlarmSensor";
110     public static final String TYPE_BSENSOR = "bsensor";
111     public static final String TYPE_THERMOSTAT = "thermostat";
112     public static final String TYPE_UNKNOWN = "unknown";
113
114     public static final int SENSOR_TYPE_TEMPERATURE = 1;
115     public static final int SENSOR_TYPE_LUMINANCE = 3;
116     public static final int SENSOR_TYPE_LEAK = 6;
117     public static final int SENSOR_TYPE_DOOR_WINDOW = 10;
118     public static final int SENSOR_TYPE_MOTION = 12;
119
120     // bsensor currStatus options
121
122     public static final String BSENSOR_STATUS_OPEN = "open";
123     public static final String BSENSOR_STATUS_CLOSE = "close";
124
125     public static final String BSENSOR_SUBTYPE_DOORWINDOW = "doors &windows";
126     public static final String BSENSOR_SUBTYPE_MOTION = "motion";
127     public static final String BSENSOR_SUBTYPE_SMOKE = "smoke";
128
129     public static final String[] SUPPORTED_TOUCHWAND_TYPES = { TYPE_WALLCONTROLLER, TYPE_SWITCH, TYPE_SHUTTER,
130             TYPE_DIMMER, TYPE_ALARMSENSOR, TYPE_BSENSOR, TYPE_THERMOSTAT };
131 }