]> git.basschouten.com Git - openhab-addons.git/blob
2a5c398496697917eb76933770deb23bd1df72d5
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.jeelink.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  * Defines common constants, which are used across the whole binding.
23  *
24  * @author Volker Bier - Initial contribution
25  */
26 @NonNullByDefault
27 public class JeeLinkBindingConstants {
28
29     private JeeLinkBindingConstants() {
30     }
31
32     public static final String BINDING_ID = "jeelink";
33
34     // List of all Thing Type UIDs
35     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>();
36     public static final Set<ThingTypeUID> SUPPORTED_SENSOR_THING_TYPES_UIDS = new HashSet<>();
37
38     public static final ThingTypeUID JEELINK_USB_STICK_THING_TYPE = new ThingTypeUID(BINDING_ID, "jeelinkUsb");
39     public static final ThingTypeUID JEELINK_TCP_STICK_THING_TYPE = new ThingTypeUID(BINDING_ID, "jeelinkTcp");
40     public static final ThingTypeUID LGW_USB_STICK_THING_TYPE = new ThingTypeUID(BINDING_ID, "lgwUsb");
41     public static final ThingTypeUID LGW_TCP_STICK_THING_TYPE = new ThingTypeUID(BINDING_ID, "lgwTcp");
42     public static final ThingTypeUID LACROSSE_SENSOR_THING_TYPE = new ThingTypeUID(BINDING_ID, "lacrosse");
43     public static final ThingTypeUID EC3000_SENSOR_THING_TYPE = new ThingTypeUID(BINDING_ID, "ec3k");
44     public static final ThingTypeUID PCA301_SENSOR_THING_TYPE = new ThingTypeUID(BINDING_ID, "pca301");
45     public static final ThingTypeUID TX22_SENSOR_THING_TYPE = new ThingTypeUID(BINDING_ID, "tx22");
46     public static final ThingTypeUID REVOLT_SENSOR_THING_TYPE = new ThingTypeUID(BINDING_ID, "revolt");
47     public static final ThingTypeUID LGW_SENSOR_THING_TYPE = new ThingTypeUID(BINDING_ID, "lgw");
48
49     // List of all channel ids for lacrosse sensor things
50     public static final String TEMPERATURE_CHANNEL = "temperature";
51     public static final String HUMIDITY_CHANNEL = "humidity";
52     public static final String BATTERY_NEW_CHANNEL = "batteryNew";
53     public static final String BATTERY_LOW_CHANNEL = "batteryLow";
54
55     public static final String PROPERTY_SENSOR_ID = "sensorId";
56
57     // List of all additional channel ids for ec3k sensor things
58     public static final String CURRENT_POWER_CHANNEL = "currentPower";
59     public static final String MAX_POWER_CHANNEL = "maxPower";
60     public static final String CONSUMPTION_CHANNEL = "consumptionTotal";
61     public static final String APPLIANCE_TIME_CHANNEL = "applianceTime";
62     public static final String SENSOR_TIME_CHANNEL = "sensorTime";
63     public static final String RESETS_CHANNEL = "resets";
64
65     // List of all additional channel ids for pca301 sensor things
66     public static final String SWITCHING_STATE_CHANNEL = "switchingState";
67
68     // List of all additional channel ids for revolt sensor things
69     public static final String POWER_FACTOR_CHANNEL = "powerFactor";
70     public static final String ELECTRIC_CURRENT_CHANNEL = "electricCurrent";
71     public static final String ELECTRIC_POTENTIAL_CHANNEL = "electricPotential";
72     public static final String FREQUENCY_CHANNEL = "powerFrequency";
73
74     // List of all additional channel ids for tx22 sensor things
75     public static final String PRESSURE_CHANNEL = "pressure";
76     public static final String RAIN_CHANNEL = "rain";
77     public static final String WIND_STENGTH_CHANNEL = "windStrength";
78     public static final String WIND_ANGLE_CHANNEL = "windAngle";
79     public static final String GUST_STRENGTH_CHANNEL = "gustStrength";
80
81     static {
82         for (SensorDefinition<?> def : SensorDefinition.getDefinitions()) {
83             SUPPORTED_SENSOR_THING_TYPES_UIDS.add(def.getThingTypeUID());
84         }
85
86         SUPPORTED_THING_TYPES_UIDS.add(JeeLinkBindingConstants.JEELINK_USB_STICK_THING_TYPE);
87         SUPPORTED_THING_TYPES_UIDS.add(JeeLinkBindingConstants.JEELINK_TCP_STICK_THING_TYPE);
88         SUPPORTED_THING_TYPES_UIDS.add(JeeLinkBindingConstants.LGW_USB_STICK_THING_TYPE);
89         SUPPORTED_THING_TYPES_UIDS.add(JeeLinkBindingConstants.LGW_TCP_STICK_THING_TYPE);
90         SUPPORTED_THING_TYPES_UIDS.addAll(SUPPORTED_SENSOR_THING_TYPES_UIDS);
91     }
92 }