2 * Copyright (c) 2010-2023 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 // 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()));
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";
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";
70 // Standalone light channels
71 public static final String CHANNEL_LIGHT_HUE = "light-hue";
72 public static final String CHANNEL_LIGHT_COLOR = "light-color";
74 // Miscellaneous channels
75 public static final String CHANNEL_MOTION = "motion";
76 public static final String CHANNEL_TIME = "time";
79 * BigAssFan thing configuration parameters
81 // IP network address of the fan
82 public static final String THING_PROPERTY_IP = "ipAddress";
84 // MAC address of the fan
85 public static final String THING_PROPERTY_MAC = "macAddress";
87 // Friendly name given to the fan
88 public static final String THING_PROPERTY_LABEL = "label";