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.milight.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 MilightBinding} class defines common constants, which are
25 * used across the whole binding.
27 * @author David Graeff - Initial contribution
30 public class MilightBindingConstants {
32 public static final String BINDING_ID = "milight";
34 // List of all Thing Type UIDs
35 public static final ThingTypeUID BRIDGEV3_THING_TYPE = new ThingTypeUID(BINDING_ID, "bridgeV3");
36 public static final ThingTypeUID BRIDGEV6_THING_TYPE = new ThingTypeUID(BINDING_ID, "bridgeV6");
38 public static final ThingTypeUID RGB_THING_TYPE = new ThingTypeUID(BINDING_ID, "rgbLed");
39 public static final ThingTypeUID RGB_V2_THING_TYPE = new ThingTypeUID(BINDING_ID, "rgbv2Led");
40 public static final ThingTypeUID RGB_IBOX_THING_TYPE = new ThingTypeUID(BINDING_ID, "rgbiboxLed");
41 public static final ThingTypeUID RGB_CW_WW_THING_TYPE = new ThingTypeUID(BINDING_ID, "rgbwwLed");
42 public static final ThingTypeUID RGB_W_THING_TYPE = new ThingTypeUID(BINDING_ID, "rgbwLed");
43 public static final ThingTypeUID WHITE_THING_TYPE = new ThingTypeUID(BINDING_ID, "whiteLed");
45 public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Collections
46 .unmodifiableSet(Stream.of(BRIDGEV3_THING_TYPE, BRIDGEV6_THING_TYPE).collect(Collectors.toSet()));
48 // List of all Channel ids
49 public static final String CHANNEL_COLOR = "ledcolor";
50 public static final String CHANNEL_NIGHTMODE = "lednightmode";
51 public static final String CHANNEL_WHITEMODE = "ledwhitemode";
52 public static final String CHANNEL_BRIGHTNESS = "ledbrightness";
53 public static final String CHANNEL_SATURATION = "ledsaturation";
54 public static final String CHANNEL_TEMP = "ledtemperature";
55 public static final String CHANNEL_SPEED_REL = "animation_speed_relative";
56 public static final String CHANNEL_ANIMATION_MODE = "animation_mode";
57 public static final String CHANNEL_ANIMATION_MODE_REL = "animation_mode_relative";
58 public static final String CHANNEL_LINKLED = "ledlink";
59 public static final String CHANNEL_UNLINKLED = "ledunlink";
61 public static final int PORT_DISCOVER = 48899;
62 public static final int PORT_VER3 = 8899;
63 public static final int PORT_VER6 = 5987;
65 public static final String PROPERTY_SESSIONID = "sessionid";
66 public static final String PROPERTY_SESSIONCONFIRMED = "sessionid_last_refresh";
68 public static final byte[] DISCOVER_MSG_V3 = "Link_Wi-Fi".getBytes();
69 public static final byte[] DISCOVER_MSG_V6 = "HF-A11ASSISTHREAD".getBytes();