]> git.basschouten.com Git - openhab-addons.git/blob
274e527861f619014490146b7388c7bade50e235
[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.plugwise.internal;
14
15 import static java.util.stream.Collectors.*;
16
17 import java.util.Collections;
18 import java.util.Set;
19 import java.util.stream.Stream;
20
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.openhab.core.thing.ThingTypeUID;
23
24 /**
25  * The {@link PlugwiseBinding} class defines common constants, which are used across the whole binding.
26  *
27  * @author Wouter Born - Initial contribution
28  */
29 @NonNullByDefault
30 public class PlugwiseBindingConstants {
31
32     public static final String BINDING_ID = "plugwise";
33
34     // List of all Channel IDs
35     public static final String CHANNEL_CLOCK = "clock";
36     public static final String CHANNEL_ENERGY = "energy";
37     public static final String CHANNEL_ENERGY_STAMP = "energystamp";
38     public static final String CHANNEL_HUMIDITY = "humidity";
39     public static final String CHANNEL_LAST_SEEN = "lastseen";
40     public static final String CHANNEL_LEFT_BUTTON_STATE = "leftbuttonstate";
41     public static final String CHANNEL_POWER = "power";
42     public static final String CHANNEL_REAL_TIME_CLOCK = "realtimeclock";
43     public static final String CHANNEL_RIGHT_BUTTON_STATE = "rightbuttonstate";
44     public static final String CHANNEL_STATE = "state";
45     public static final String CHANNEL_TEMPERATURE = "temperature";
46     public static final String CHANNEL_TRIGGERED = "triggered";
47
48     // List of all configuration properties
49     public static final String CONFIG_PROPERTY_MAC_ADDRESS = "macAddress";
50     public static final String CONFIG_PROPERTY_RECALIBRATE = "recalibrate";
51     public static final String CONFIG_PROPERTY_SERIAL_PORT = "serialPort";
52     public static final String CONFIG_PROPERTY_UPDATE_CONFIGURATION = "updateConfiguration";
53     public static final String CONFIG_PROPERTY_UPDATE_INTERVAL = "updateInterval";
54
55     // List of all property IDs
56     public static final String PROPERTY_HERTZ = "hertz";
57     public static final String PROPERTY_MAC_ADDRESS = "macAddress";
58
59     // List of all Thing Type UIDs
60     public static final ThingTypeUID THING_TYPE_CIRCLE = new ThingTypeUID(BINDING_ID, "circle");
61     public static final ThingTypeUID THING_TYPE_CIRCLE_PLUS = new ThingTypeUID(BINDING_ID, "circleplus");
62     public static final ThingTypeUID THING_TYPE_SCAN = new ThingTypeUID(BINDING_ID, "scan");
63     public static final ThingTypeUID THING_TYPE_SENSE = new ThingTypeUID(BINDING_ID, "sense");
64     public static final ThingTypeUID THING_TYPE_STEALTH = new ThingTypeUID(BINDING_ID, "stealth");
65     public static final ThingTypeUID THING_TYPE_STICK = new ThingTypeUID(BINDING_ID, "stick");
66     public static final ThingTypeUID THING_TYPE_SWITCH = new ThingTypeUID(BINDING_ID, "switch");
67
68     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream
69             .of(THING_TYPE_CIRCLE, THING_TYPE_CIRCLE_PLUS, THING_TYPE_SCAN, THING_TYPE_SENSE, THING_TYPE_STEALTH,
70                     THING_TYPE_STICK, THING_TYPE_SWITCH)
71             .collect(collectingAndThen(toSet(), Collections::unmodifiableSet));
72 }