]> git.basschouten.com Git - openhab-addons.git/blob
48f3000680a52404ec76585cc40e6341345b9c9a
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.wemo.internal;
14
15 import java.util.Collections;
16 import java.util.Set;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
22
23 /**
24  * The {@link WemoBinding} class defines common constants, which are
25  * used across the whole binding.
26  *
27  * @author Hans-Jörg Merk - Initial contribution
28  * @author Mihir Patil - Added standby switch
29  */
30 @NonNullByDefault
31 public class WemoBindingConstants {
32
33     public static final String BINDING_ID = "wemo";
34
35     // List of all Thing Type UIDs
36     public static final ThingTypeUID THING_TYPE_SOCKET = new ThingTypeUID(BINDING_ID, "socket");
37     public static final ThingTypeUID THING_TYPE_INSIGHT = new ThingTypeUID(BINDING_ID, "insight");
38     public static final ThingTypeUID THING_TYPE_LIGHTSWITCH = new ThingTypeUID(BINDING_ID, "lightswitch");
39     public static final ThingTypeUID THING_TYPE_MOTION = new ThingTypeUID(BINDING_ID, "motion");
40     public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
41     public static final ThingTypeUID THING_TYPE_MZ100 = new ThingTypeUID(BINDING_ID, "MZ100");
42     public static final ThingTypeUID THING_TYPE_MAKER = new ThingTypeUID(BINDING_ID, "Maker");
43     public static final ThingTypeUID THING_TYPE_COFFEE = new ThingTypeUID(BINDING_ID, "CoffeeMaker");
44     public static final ThingTypeUID THING_TYPE_DIMMER = new ThingTypeUID(BINDING_ID, "dimmer");
45     public static final ThingTypeUID THING_TYPE_CROCKPOT = new ThingTypeUID(BINDING_ID, "Crockpot");
46     public static final ThingTypeUID THING_TYPE_PURIFIER = new ThingTypeUID(BINDING_ID, "Purifier");
47     public static final ThingTypeUID THING_TYPE_HUMIDIFIER = new ThingTypeUID(BINDING_ID, "Humidifier");
48     public static final ThingTypeUID THING_TYPE_HEATER = new ThingTypeUID(BINDING_ID, "Heater");
49
50     // List of all Channel ids
51     public static final String CHANNEL_STATE = "state";
52     public static final String CHANNEL_MOTIONDETECTION = "motionDetection";
53     public static final String CHANNEL_LASTMOTIONDETECTED = "lastMotionDetected";
54     public static final String CHANNEL_LASTCHANGEDAT = "lastChangedAt";
55     public static final String CHANNEL_LASTONFOR = "lastOnFor";
56     public static final String CHANNEL_ONTODAY = "onToday";
57     public static final String CHANNEL_ONTOTAL = "onTotal";
58     public static final String CHANNEL_TIMESPAN = "timespan";
59     public static final String CHANNEL_AVERAGEPOWER = "averagePower";
60     public static final String CHANNEL_CURRENTPOWER = "currentPower";
61     public static final String CHANNEL_ENERGYTODAY = "energyToday";
62     public static final String CHANNEL_ENERGYTOTAL = "energyTotal";
63     public static final String CHANNEL_STANDBYLIMIT = "standByLimit";
64     public static final String CHANNEL_BRIGHTNESS = "brightness";
65     public static final String CHANNEL_RELAY = "relay";
66     public static final String CHANNEL_SENSOR = "sensor";
67     public static final String CHANNEL_ONSTANDBY = "onStandBy";
68
69     public static final String CHANNEL_COFFEEMODE = "coffeeMode";
70     public static final String CHANNEL_MODETIME = "modeTime";
71     public static final String CHANNEL_TIMEREMAINING = "timeRemaining";
72     public static final String CHANNEL_WATERLEVELREACHED = "waterLevelReached";
73     public static final String CHANNEL_CLEANADVISE = "cleanAdvise";
74     public static final String CHANNEL_FILTERADVISE = "filterAdvise";
75     public static final String CHANNEL_BREWED = "brewed";
76     public static final String CHANNEL_LASTCLEANED = "lastCleaned";
77
78     public static final String CHANNEL_FADERENABLED = "faderEnabled";
79     public static final String CHANNEL_TIMERSTART = "timerStart";
80     public static final String CHANNEL_FADERCOUNTDOWNTIME = "faderCountDownTime";
81     public static final String CHANNEL_NIGHTMODE = "nightMode";
82     public static final String CHANNEL_STARTTIME = "startTime";
83     public static final String CHANNEL_ENDTIME = "endTime";
84     public static final String CHANNEL_NIGHTMODEBRIGHTNESS = "nightModeBrightness";
85
86     public static final String CHANNEL_COOKMODE = "cookMode";
87     public static final String CHANNEL_LOWCOOKTIME = "lowCookTime";
88     public static final String CHANNEL_WARMCOOKTIME = "warmCooktime";
89     public static final String CHANNEL_HIGHCOOKTIME = "highCooktime";
90     public static final String CHANNEL_COOKEDTIME = "cookedtime";
91
92     public static final String CHANNEL_PURIFIERMODE = "purifierMode";
93     public static final String CHANNEL_AIRQUALITY = "airQuality";
94     public static final String CHANNEL_IONIZER = "ionizer";
95     public static final String CHANNEL_FILTERLIFE = "filterLife";
96     public static final String CHANNEL_EXPIREDFILTERTIME = "expiredFilterTime";
97     public static final String CHANNEL_FILTERPRESENT = "filterPresent";
98
99     public static final String CHANNEL_HUMIDIFIERMODE = "humidifierMode";
100     public static final String CHANNEL_CURRENTHUMIDITY = "currentHumidity";
101     public static final String CHANNEL_DESIREDHUMIDITY = "desiredHumidity";
102     public static final String CHANNEL_WATERLEVEL = "waterLEvel";
103
104     public static final String CHANNEL_HEATERMODE = "heaterMode";
105     public static final String CHANNEL_CURRENTTEMP = "currentTemperature";
106     public static final String CHANNEL_TARGETTEMP = "targetTemperature";
107     public static final String CHANNEL_AUTOOFFTIME = "autoOffTime";
108     public static final String CHANNEL_HEATINGREMAINING = "heatingRemaining";
109
110     // List of thing configuration properties
111     public static final String UDN = "udn";
112     public static final String DEVICE_ID = "deviceID";
113     public static final String POLLINGINTERVALL = "pollingInterval";
114     public static final int DEFAULT_REFRESH_INTERVAL_SECONDS = 60;
115     public static final int SUBSCRIPTION_DURATION_SECONDS = 600;
116     public static final int LINK_DISCOVERY_SERVICE_INITIAL_DELAY = 5;
117     public static final String HTTP_CALL_CONTENT_HEADER = "text/xml; charset=utf-8";
118
119     public static final String BASICACTION = "basicevent";
120     public static final String BASICEVENT = "basicevent1";
121     public static final String BRIDGEACTION = "bridge";
122     public static final String BRIDGEEVENT = "bridge1";
123     public static final String DEVICEACTION = "deviceevent";
124     public static final String DEVICEEVENT = "deviceevent1";
125     public static final String INSIGHTACTION = "insight";
126     public static final String INSIGHTEVENT = "insight1";
127
128     public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_THING_TYPES = Collections.singleton(THING_TYPE_BRIDGE);
129
130     public static final Set<ThingTypeUID> SUPPORTED_LIGHT_THING_TYPES = Collections.singleton(THING_TYPE_MZ100);
131
132     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections
133             .unmodifiableSet(Stream
134                     .of(THING_TYPE_SOCKET, THING_TYPE_INSIGHT, THING_TYPE_LIGHTSWITCH, THING_TYPE_MOTION,
135                             THING_TYPE_BRIDGE, THING_TYPE_MZ100, THING_TYPE_MAKER, THING_TYPE_COFFEE, THING_TYPE_DIMMER,
136                             THING_TYPE_CROCKPOT, THING_TYPE_PURIFIER, THING_TYPE_HUMIDIFIER, THING_TYPE_HEATER)
137                     .collect(Collectors.toSet()));
138 }