2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.wemo.internal;
15 import java.util.Collections;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.openhab.core.thing.ThingTypeUID;
24 * The {@link WemoBinding} class defines common constants, which are
25 * used across the whole binding.
27 * @author Hans-Jörg Merk - Initial contribution
28 * @author Mihir Patil - Added standby switch
31 public class WemoBindingConstants {
33 public static final String BINDING_ID = "wemo";
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");
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";
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";
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";
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";
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";
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";
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";
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";
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";
128 public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_THING_TYPES = Collections.singleton(THING_TYPE_BRIDGE);
130 public static final Set<ThingTypeUID> SUPPORTED_LIGHT_THING_TYPES = Collections.singleton(THING_TYPE_MZ100);
132 public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES = Collections
133 .unmodifiableSet(Stream.of(THING_TYPE_SOCKET, THING_TYPE_INSIGHT, THING_TYPE_LIGHTSWITCH, THING_TYPE_MOTION)
134 .collect(Collectors.toSet()));
136 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections
137 .unmodifiableSet(Stream
138 .of(THING_TYPE_SOCKET, THING_TYPE_INSIGHT, THING_TYPE_LIGHTSWITCH, THING_TYPE_MOTION,
139 THING_TYPE_BRIDGE, THING_TYPE_MZ100, THING_TYPE_MAKER, THING_TYPE_COFFEE, THING_TYPE_DIMMER,
140 THING_TYPE_CROCKPOT, THING_TYPE_PURIFIER, THING_TYPE_HUMIDIFIER, THING_TYPE_HEATER)
141 .collect(Collectors.toSet()));