]> git.basschouten.com Git - openhab-addons.git/blob
64706014cde425b8166edbbd1e2acda2e22b3121
[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_MOTION_DETECTION = "motionDetection";
53     public static final String CHANNEL_LAST_MOTION_DETECTED = "lastMotionDetected";
54     public static final String CHANNEL_LAST_CHANGED_AT = "lastChangedAt";
55     public static final String CHANNEL_LAST_ON_FOR = "lastOnFor";
56     public static final String CHANNEL_ON_TODAY = "onToday";
57     public static final String CHANNEL_ON_TOTAL = "onTotal";
58     public static final String CHANNEL_TIMESPAN = "timespan";
59     public static final String CHANNEL_AVERAGE_POWER = "averagePower";
60     public static final String CHANNEL_CURRENT_POWER = "currentPower";
61     public static final String CHANNEL_CURRENT_POWER_RAW = "currentPowerRaw";
62     public static final String CHANNEL_ENERGY_TODAY = "energyToday";
63     public static final String CHANNEL_ENERGY_TOTAL = "energyTotal";
64     public static final String CHANNEL_STAND_BY_LIMIT = "standByLimit";
65     public static final String CHANNEL_BRIGHTNESS = "brightness";
66     public static final String CHANNEL_RELAY = "relay";
67     public static final String CHANNEL_SENSOR = "sensor";
68     public static final String CHANNEL_ON_STAND_BY = "onStandBy";
69
70     public static final String CHANNEL_COFFEE_MODE = "coffeeMode";
71     public static final String CHANNEL_MODE_TIME = "modeTime";
72     public static final String CHANNEL_TIME_REMAINING = "timeRemaining";
73     public static final String CHANNEL_WATER_LEVEL_REACHED = "waterLevelReached";
74     public static final String CHANNEL_CLEAN_ADVISE = "cleanAdvise";
75     public static final String CHANNEL_FILTER_ADVISE = "filterAdvise";
76     public static final String CHANNEL_BREWED = "brewed";
77     public static final String CHANNEL_LAST_CLEANED = "lastCleaned";
78
79     public static final String CHANNEL_FADER_ENABLED = "faderEnabled";
80     public static final String CHANNEL_TIMER_START = "timerStart";
81     public static final String CHANNEL_FADER_COUNT_DOWN_TIME = "faderCountDownTime";
82     public static final String CHANNEL_NIGHT_MODE = "nightMode";
83     public static final String CHANNEL_START_TIME = "startTime";
84     public static final String CHANNEL_END_TIME = "endTime";
85     public static final String CHANNEL_NIGHT_MODE_BRIGHTNESS = "nightModeBrightness";
86
87     public static final String CHANNEL_COOK_MODE = "cookMode";
88     public static final String CHANNEL_LOW_COOK_TIME = "lowCookTime";
89     public static final String CHANNEL_WARM_COOK_TIME = "warmCooktime";
90     public static final String CHANNEL_HIGHCOOKTIME = "highCooktime";
91     public static final String CHANNEL_COOKED_TIME = "cookedtime";
92
93     public static final String CHANNEL_PURIFIER_MODE = "purifierMode";
94     public static final String CHANNEL_AIR_QUALITY = "airQuality";
95     public static final String CHANNEL_IONIZER = "ionizer";
96     public static final String CHANNEL_FILTER_LIFE = "filterLife";
97     public static final String CHANNEL_EXPIRED_FILTER_TIME = "expiredFilterTime";
98     public static final String CHANNEL_FILTER_PRESENT = "filterPresent";
99
100     public static final String CHANNEL_HUMIDIFIER_MODE = "humidifierMode";
101     public static final String CHANNEL_CURRENT_HUMIDITY = "currentHumidity";
102     public static final String CHANNEL_DESIRED_HUMIDITY = "desiredHumidity";
103     public static final String CHANNEL_WATER_LEVEL = "waterLEvel";
104
105     public static final String CHANNEL_HEATER_MODE = "heaterMode";
106     public static final String CHANNEL_CURRENT_TEMPERATURE = "currentTemperature";
107     public static final String CHANNEL_TARGET_TEMPERATURE = "targetTemperature";
108     public static final String CHANNEL_AUTO_OFF_TIME = "autoOffTime";
109     public static final String CHANNEL_HEATING_REMAINING = "heatingRemaining";
110
111     // List of thing configuration properties
112     public static final String UDN = "udn";
113     public static final String DEVICE_ID = "deviceID";
114     public static final String POLLING_INTERVAL = "pollingInterval";
115     public static final int DEFAULT_REFRESH_INTERVAL_SECONDS = 60;
116     public static final int SUBSCRIPTION_DURATION_SECONDS = 600;
117     public static final int LINK_DISCOVERY_SERVICE_INITIAL_DELAY = 5;
118     public static final String HTTP_CALL_CONTENT_HEADER = "text/xml; charset=utf-8";
119
120     public static final String BASICACTION = "basicevent";
121     public static final String BASICEVENT = "basicevent1";
122     public static final String BRIDGEACTION = "bridge";
123     public static final String BRIDGEEVENT = "bridge1";
124     public static final String DEVICEACTION = "deviceevent";
125     public static final String DEVICEEVENT = "deviceevent1";
126     public static final String INSIGHTACTION = "insight";
127     public static final String INSIGHTEVENT = "insight1";
128
129     public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_THING_TYPES = Collections.singleton(THING_TYPE_BRIDGE);
130
131     public static final Set<ThingTypeUID> SUPPORTED_LIGHT_THING_TYPES = Collections.singleton(THING_TYPE_MZ100);
132
133     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections
134             .unmodifiableSet(Stream
135                     .of(THING_TYPE_SOCKET, THING_TYPE_INSIGHT, THING_TYPE_LIGHTSWITCH, THING_TYPE_MOTION,
136                             THING_TYPE_BRIDGE, THING_TYPE_MZ100, THING_TYPE_MAKER, THING_TYPE_COFFEE, THING_TYPE_DIMMER,
137                             THING_TYPE_CROCKPOT, THING_TYPE_PURIFIER, THING_TYPE_HUMIDIFIER, THING_TYPE_HEATER)
138                     .collect(Collectors.toSet()));
139 }