]> git.basschouten.com Git - openhab-addons.git/blob
7e935c2418196e19fb07bf0db6c8e460546e4e0c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.bigassfan.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 BigAssFanBindingConstants} class defines common constants, which are
25  * used across the whole binding.
26  *
27  * @author Mark Hilbush - Initial contribution
28  */
29 @NonNullByDefault
30 public class BigAssFanBindingConstants {
31
32     public static final String BINDING_ID = "bigassfan";
33
34     // Fans communicate on this port using both UDP (discovery) and TCP (commands)
35     public static final int BAF_PORT = 31415;
36
37     // Commands sent to/from fan are ASCII
38     public static final String CHARSET = "US-ASCII";
39
40     // BigAssFan Thing Type UIDs
41     public static final ThingTypeUID THING_TYPE_FAN = new ThingTypeUID(BINDING_ID, "fan");
42     public static final ThingTypeUID THING_TYPE_LIGHT = new ThingTypeUID(BINDING_ID, "light");
43     public static final ThingTypeUID THING_TYPE_CONTROLLER = new ThingTypeUID(BINDING_ID, "controller");
44     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
45             Stream.of(THING_TYPE_FAN, THING_TYPE_LIGHT, THING_TYPE_CONTROLLER).collect(Collectors.toSet()));
46
47     /*
48      * List of Channel Ids
49      */
50     // Fan control channels
51     public static final String CHANNEL_FAN_POWER = "fan-power";
52     public static final String CHANNEL_FAN_SPEED = "fan-speed";
53     public static final String CHANNEL_FAN_DIRECTION = "fan-direction";
54     public static final String CHANNEL_FAN_AUTO = "fan-auto";
55     public static final String CHANNEL_FAN_WHOOSH = "fan-whoosh";
56     public static final String CHANNEL_FAN_SMARTMODE = "fan-smartmode";
57     public static final String CHANNEL_FAN_SPEED_MIN = "fan-speed-min";
58     public static final String CHANNEL_FAN_SPEED_MAX = "fan-speed-max";
59     public static final String CHANNEL_FAN_LEARN_MINSPEED = "fan-learn-speed-min";
60     public static final String CHANNEL_FAN_LEARN_MAXSPEED = "fan-learn-speed-max";
61     public static final String CHANNEL_FAN_WINTERMODE = "fan-wintermode";
62     public static final String CHANNEL_FAN_SLEEP = "fan-sleep";
63
64     // Light control channels
65     public static final String CHANNEL_LIGHT_POWER = "light-power";
66     public static final String CHANNEL_LIGHT_LEVEL = "light-level";
67     public static final String CHANNEL_LIGHT_AUTO = "light-auto";
68     public static final String CHANNEL_LIGHT_SMARTER = "light-smarter";
69     public static final String CHANNEL_LIGHT_LEVEL_MIN = "light-level-min";
70     public static final String CHANNEL_LIGHT_LEVEL_MAX = "light-level-max";
71     public static final String CHANNEL_LIGHT_PRESENT = "light-present";
72
73     // Standalone light channels
74     public static final String CHANNEL_LIGHT_HUE = "light-hue";
75     public static final String CHANNEL_LIGHT_COLOR = "light-color";
76
77     // Miscellaneous channels
78     public static final String CHANNEL_MOTION = "motion";
79     public static final String CHANNEL_TIME = "time";
80
81     /*
82      * BigAssFan thing configuration parameters
83      */
84     // IP network address of the fan
85     public static final String THING_PROPERTY_IP = "ipAddress";
86
87     // MAC address of the fan
88     public static final String THING_PROPERTY_MAC = "macAddress";
89
90     // Friendly name given to the fan
91     public static final String THING_PROPERTY_LABEL = "label";
92 }