]> git.basschouten.com Git - openhab-addons.git/blob
799a796cffd1b0448c90ffce01d3db731cf9f8e6
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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     // BigAssFan Thing Type UIDs
38     public static final ThingTypeUID THING_TYPE_FAN = new ThingTypeUID(BINDING_ID, "fan");
39     public static final ThingTypeUID THING_TYPE_LIGHT = new ThingTypeUID(BINDING_ID, "light");
40     public static final ThingTypeUID THING_TYPE_CONTROLLER = new ThingTypeUID(BINDING_ID, "controller");
41     public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(
42             Stream.of(THING_TYPE_FAN, THING_TYPE_LIGHT, THING_TYPE_CONTROLLER).collect(Collectors.toSet()));
43
44     /*
45      * List of Channel Ids
46      */
47     // Fan control channels
48     public static final String CHANNEL_FAN_POWER = "fan-power";
49     public static final String CHANNEL_FAN_SPEED = "fan-speed";
50     public static final String CHANNEL_FAN_DIRECTION = "fan-direction";
51     public static final String CHANNEL_FAN_AUTO = "fan-auto";
52     public static final String CHANNEL_FAN_WHOOSH = "fan-whoosh";
53     public static final String CHANNEL_FAN_SMARTMODE = "fan-smartmode";
54     public static final String CHANNEL_FAN_SPEED_MIN = "fan-speed-min";
55     public static final String CHANNEL_FAN_SPEED_MAX = "fan-speed-max";
56     public static final String CHANNEL_FAN_LEARN_MINSPEED = "fan-learn-speed-min";
57     public static final String CHANNEL_FAN_LEARN_MAXSPEED = "fan-learn-speed-max";
58     public static final String CHANNEL_FAN_WINTERMODE = "fan-wintermode";
59     public static final String CHANNEL_FAN_SLEEP = "fan-sleep";
60
61     // Light control channels
62     public static final String CHANNEL_LIGHT_POWER = "light-power";
63     public static final String CHANNEL_LIGHT_LEVEL = "light-level";
64     public static final String CHANNEL_LIGHT_AUTO = "light-auto";
65     public static final String CHANNEL_LIGHT_SMARTER = "light-smarter";
66     public static final String CHANNEL_LIGHT_LEVEL_MIN = "light-level-min";
67     public static final String CHANNEL_LIGHT_LEVEL_MAX = "light-level-max";
68     public static final String CHANNEL_LIGHT_PRESENT = "light-present";
69
70     // Standalone light channels
71     public static final String CHANNEL_LIGHT_HUE = "light-hue";
72     public static final String CHANNEL_LIGHT_COLOR = "light-color";
73
74     // Miscellaneous channels
75     public static final String CHANNEL_MOTION = "motion";
76     public static final String CHANNEL_TIME = "time";
77
78     /*
79      * BigAssFan thing configuration parameters
80      */
81     // IP network address of the fan
82     public static final String THING_PROPERTY_IP = "ipAddress";
83
84     // MAC address of the fan
85     public static final String THING_PROPERTY_MAC = "macAddress";
86
87     // Friendly name given to the fan
88     public static final String THING_PROPERTY_LABEL = "label";
89 }