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