]> git.basschouten.com Git - openhab-addons.git/blob
b8e243a5a5778eb3dbd0b692dc255d8535500921
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.tplinksmarthome.internal;
14
15 import java.util.Set;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20
21 /**
22  * This class defines common constants, which are used across the whole binding.
23  *
24  * @author Christian Fischer - Initial contribution
25  * @author Hilbrand Bouwkamp - Added channel and property keys
26  */
27 @NonNullByDefault
28 public final class TPLinkSmartHomeBindingConstants {
29
30     public static final String BINDING_ID = "tplinksmarthome";
31
32     // List of all switch channel ids
33     public static final String CHANNEL_SWITCH = "switch";
34
35     // List of all plug channel ids
36     public static final String CHANNEL_LED = "led";
37
38     // List of all bulb channel ids
39     public static final String CHANNEL_BRIGHTNESS = "brightness";
40     public static final String CHANNEL_COLOR = "color";
41     public static final String CHANNEL_COLOR_TEMPERATURE = "colorTemperature";
42     public static final String CHANNEL_COLOR_TEMPERATURE_ABS = "colorTemperatureAbs";
43     public static final int COLOR_TEMPERATURE_1_MIN = 2700;
44     public static final int COLOR_TEMPERATURE_1_MAX = 6500;
45     public static final int COLOR_TEMPERATURE_2_MIN = 2500;
46     public static final int COLOR_TEMPERATURE_2_MAX = 9000;
47
48     public static final Set<String> CHANNELS_BULB_SWITCH = Stream.of(CHANNEL_BRIGHTNESS, CHANNEL_COLOR,
49             CHANNEL_COLOR_TEMPERATURE, CHANNEL_COLOR_TEMPERATURE_ABS, CHANNEL_SWITCH).collect(Collectors.toSet());
50
51     // List of all energy channel ids
52     public static final String CHANNEL_ENERGY_POWER = "power";
53     public static final String CHANNEL_ENERGY_TOTAL = "energyUsage";
54     public static final String CHANNEL_ENERGY_VOLTAGE = "voltage";
55     public static final String CHANNEL_ENERGY_CURRENT = "current";
56     public static final Set<String> CHANNELS_ENERGY = Stream
57             .of(CHANNEL_ENERGY_POWER, CHANNEL_ENERGY_TOTAL, CHANNEL_ENERGY_VOLTAGE, CHANNEL_ENERGY_CURRENT)
58             .collect(Collectors.toSet());
59
60     // List of all misc channel ids
61     public static final String CHANNEL_RSSI = "rssi";
62
63     // List of all group channel ids
64     public static final String CHANNEL_SWITCH_GROUP = "group";
65     public static final String CHANNEL_OUTLET_GROUP_PREFIX = "outlet";
66
67     // List of configuration keys
68     public static final String CONFIG_IP = "ipAddress";
69     public static final String CONFIG_DEVICE_ID = "deviceId";
70     public static final String CONFIG_REFRESH = "refresh";
71     // Only for bulbs
72     public static final String CONFIG_TRANSITION_PERIOD = "transitionPeriod";
73
74     // List of property keys
75     public static final String PROPERTY_TYPE = "type";
76     public static final String PROPERTY_MODEL = "model";
77     public static final String PROPERTY_DEVICE_NAME = "device name";
78     public static final String PROPERTY_MAC = "mac";
79     public static final String PROPERTY_HARDWARE_VERSION = "hardware version";
80     public static final String PROPERTY_SOFWARE_VERSION = "sofware version";
81     public static final String PROPERTY_HARDWARE_ID = "hardware id";
82     public static final String PROPERTY_FIRMWARE_ID = "firmware id";
83     public static final String PROPERTY_OEM_ID = "oem id";
84     public static final String PROPERTY_FEATURE = "feature";
85     public static final String PROPERTY_PROTOCOL_NAME = "protocol name";
86     public static final String PROPERTY_PROTOCOL_VERSION = "protocol version";
87
88     public static final int FORCED_REFRESH_BOUNDERY_SECONDS = 60;
89     public static final int FORCED_REFRESH_BOUNDERY_SWITCHED_SECONDS = 5;
90
91     private TPLinkSmartHomeBindingConstants() {
92         // Constants class
93     }
94 }