]> git.basschouten.com Git - openhab-addons.git/blob
36d7b45f36a224b88d7a6f86378b791d68915f52
[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.milight.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 MilightBindingConstants} class defines common constants, which are
25  * used across the whole binding.
26  *
27  * @author David Graeff - Initial contribution
28  */
29 @NonNullByDefault
30 public class MilightBindingConstants {
31
32     public static final String BINDING_ID = "milight";
33
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");
37
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");
44
45     public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Collections
46             .unmodifiableSet(Stream.of(BRIDGEV3_THING_TYPE, BRIDGEV6_THING_TYPE).collect(Collectors.toSet()));
47
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";
60
61     public static final int PORT_DISCOVER = 48899;
62     public static final int PORT_VER3 = 8899;
63     public static final int PORT_VER6 = 5987;
64
65     public static final String PROPERTY_SESSIONID = "sessionid";
66     public static final String PROPERTY_SESSIONCONFIRMED = "sessionid_last_refresh";
67
68     public static final byte[] DISCOVER_MSG_V3 = "Link_Wi-Fi".getBytes();
69     public static final byte[] DISCOVER_MSG_V6 = "HF-A11ASSISTHREAD".getBytes();
70 }