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.bigassfan.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 BigAssFanBindingConstants} class defines common constants, which are
25 * used across the whole binding.
27 * @author Mark Hilbush - Initial contribution
30 public class BigAssFanBindingConstants {
32 public static final String BINDING_ID = "bigassfan";
34 // Fans communicate on this port using both UDP (discovery) and TCP (commands)
35 public static final int BAF_PORT = 31415;
37 // Commands sent to/from fan are ASCII
38 public static final String CHARSET = "US-ASCII";
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()));
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";
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";
73 // Standalone light channels
74 public static final String CHANNEL_LIGHT_HUE = "light-hue";
75 public static final String CHANNEL_LIGHT_COLOR = "light-color";
77 // Miscellaneous channels
78 public static final String CHANNEL_MOTION = "motion";
79 public static final String CHANNEL_TIME = "time";
82 * BigAssFan thing configuration parameters
84 // IP network address of the fan
85 public static final String THING_PROPERTY_IP = "ipAddress";
87 // MAC address of the fan
88 public static final String THING_PROPERTY_MAC = "macAddress";
90 // Friendly name given to the fan
91 public static final String THING_PROPERTY_LABEL = "label";