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.dmx.internal;
15 import java.util.Collections;
17 import java.util.stream.Collectors;
18 import java.util.stream.Stream;
20 import org.openhab.core.thing.ThingTypeUID;
21 import org.openhab.core.thing.type.ChannelTypeUID;
24 * The {@link DmxBindingConstants} class defines common constants, which are
25 * used across the whole binding.
27 * @author Jan N. Klug - Initial contribution
29 public class DmxBindingConstants {
31 public static final String BINDING_ID = "dmx";
33 // List of all Thing Type UIDs
34 public static final ThingTypeUID THING_TYPE_CHASER = new ThingTypeUID(BINDING_ID, "chaser");
35 public static final ThingTypeUID THING_TYPE_DIMMER = new ThingTypeUID(BINDING_ID, "dimmer");
36 public static final ThingTypeUID THING_TYPE_COLOR = new ThingTypeUID(BINDING_ID, "color");
37 public static final ThingTypeUID THING_TYPE_TUNABLEWHITE = new ThingTypeUID(BINDING_ID, "tunablewhite");
38 public static final ThingTypeUID THING_TYPE_ARTNET_BRIDGE = new ThingTypeUID(BINDING_ID, "artnet-bridge");
39 public static final ThingTypeUID THING_TYPE_LIB485_BRIDGE = new ThingTypeUID(BINDING_ID, "lib485-bridge");
40 public static final ThingTypeUID THING_TYPE_SACN_BRIDGE = new ThingTypeUID(BINDING_ID, "sacn-bridge");
42 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.unmodifiableSet(
43 Stream.of(THING_TYPE_ARTNET_BRIDGE, THING_TYPE_LIB485_BRIDGE, THING_TYPE_SACN_BRIDGE, THING_TYPE_CHASER,
44 THING_TYPE_COLOR, THING_TYPE_DIMMER, THING_TYPE_TUNABLEWHITE).collect(Collectors.toSet()));
46 // List of all config options
47 public static final String CONFIG_UNIVERSE = "universe";
48 public static final String CONFIG_DMX_ID = "dmxid";
49 public static final String CONFIG_APPLY_CURVE = "applycurve";
50 public static final String CONFIG_REFRESH_RATE = "refreshrate";
52 public static final String CONFIG_SACN_MODE = "mode";
53 public static final String CONFIG_ADDRESS = "address";
54 public static final String CONFIG_LOCAL_ADDRESS = "localaddress";
55 public static final String CONFIG_REFRESH_MODE = "refreshmode";
57 public static final String CONFIG_DIMMER_TYPE = "dimmertype";
58 public static final String CONFIG_DIMMER_FADE_TIME = "fadetime";
59 public static final String CONFIG_DIMMER_DIM_TIME = "dimtime";
60 public static final String CONFIG_DIMMER_TURNONVALUE = "turnonvalue";
61 public static final String CONFIG_DIMMER_TURNOFFVALUE = "turnoffvalue";
62 public static final String CONFIG_DIMMER_DYNAMICTURNONVALUE = "dynamicturnonvalue";
63 public static final String CONFIG_CHASER_STEPS = "steps";
64 public static final String CONFIG_CHASER_RESUME_AFTER = "resumeafter";
66 // List of all channels
67 public static final String CHANNEL_BRIGHTNESS = "brightness";
68 public static final String CHANNEL_BRIGHTNESS_R = "brightness_r";
69 public static final String CHANNEL_BRIGHTNESS_G = "brightness_g";
70 public static final String CHANNEL_BRIGHTNESS_B = "brightness_b";
71 public static final String CHANNEL_BRIGHTNESS_CW = "brightness_cw";
72 public static final String CHANNEL_BRIGHTNESS_WW = "brightness_ww";
74 public static final String CHANNEL_COLOR = "color";
75 public static final String CHANNEL_COLOR_TEMPERATURE = "color_temperature";
76 public static final String CHANNEL_SWITCH = "switch";
77 public static final String CHANNEL_CONTROL = "control";
78 public static final String CHANNEL_MUTE = "mute";
80 public static final ChannelTypeUID BRIGHTNESS_CHANNEL_TYPEUID = new ChannelTypeUID(BINDING_ID, CHANNEL_BRIGHTNESS);
82 public static final ChannelTypeUID COLOR_CHANNEL_TYPEUID = new ChannelTypeUID(BINDING_ID, CHANNEL_COLOR);
83 public static final ChannelTypeUID COLOR_TEMPERATURE_CHANNEL_TYPEUID = new ChannelTypeUID(BINDING_ID,
84 CHANNEL_COLOR_TEMPERATURE);
85 public static final ChannelTypeUID SWITCH_CHANNEL_TYPEUID = new ChannelTypeUID(BINDING_ID, CHANNEL_SWITCH);
86 public static final ChannelTypeUID CONTROL_CHANNEL_TYPEUID = new ChannelTypeUID(BINDING_ID, CHANNEL_CONTROL);
87 public static final ChannelTypeUID MUTE_CHANNEL_TYPEUID = new ChannelTypeUID(BINDING_ID, CHANNEL_MUTE);
89 // Listener Type for channel updates
90 public static enum ListenerType {