]> git.basschouten.com Git - openhab-addons.git/blob
6ec8a777aa24a3a54195dfe849f1a69e462218c7
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.nanoleaf.internal;
14
15 import java.util.Arrays;
16 import java.util.List;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.openhab.core.thing.ThingTypeUID;
20
21 /**
22  * The {@link NanoleafBindingConstants} class defines common constants, which are
23  * used across the whole binding.
24  *
25  * @author Martin Raepple - Initial contribution
26  */
27 @NonNullByDefault
28 public class NanoleafBindingConstants {
29
30     public static final String BINDING_ID = "nanoleaf";
31
32     // List of all Thing Type UIDs
33     public static final ThingTypeUID THING_TYPE_CONTROLLER = new ThingTypeUID(BINDING_ID, "controller");
34     public static final ThingTypeUID THING_TYPE_LIGHT_PANEL = new ThingTypeUID(BINDING_ID, "lightpanel");
35
36     // Controller configuration settings
37     public static final String CONFIG_ADDRESS = "address";
38     public static final String CONFIG_PORT = "port";
39     public static final String CONFIG_AUTH_TOKEN = "authToken";
40     public static final String CONFIG_DEVICE_TYPE_CANVAS = "canvas";
41     public static final String CONFIG_DEVICE_TYPE_LIGHTPANELS = "lightPanels";
42
43     // Panel configuration settings
44     public static final String CONFIG_PANEL_ID = "id";
45     public static final String CONTROLLER_PANEL_ID = "-1";
46
47     // List of controller channels
48     public static final String CHANNEL_COLOR = "color";
49     public static final String CHANNEL_COLOR_TEMPERATURE = "colorTemperature";
50     public static final String CHANNEL_COLOR_TEMPERATURE_ABS = "colorTemperatureAbs";
51     public static final String CHANNEL_COLOR_MODE = "colorMode";
52     public static final String CHANNEL_EFFECT = "effect";
53     public static final String CHANNEL_RHYTHM_STATE = "rhythmState";
54     public static final String CHANNEL_RHYTHM_ACTIVE = "rhythmActive";
55     public static final String CHANNEL_RHYTHM_MODE = "rhythmMode";
56     public static final String CHANNEL_SWIPE = "swipe";
57     public static final String CHANNEL_SWIPE_EVENT_UP = "UP";
58     public static final String CHANNEL_SWIPE_EVENT_DOWN = "DOWN";
59     public static final String CHANNEL_SWIPE_EVENT_LEFT = "LEFT";
60     public static final String CHANNEL_SWIPE_EVENT_RIGHT = "RIGHT";
61
62     // List of light panel channels
63     public static final String CHANNEL_PANEL_COLOR = "color";
64     public static final String CHANNEL_PANEL_TAP = "tap";
65
66     // Nanoleaf OpenAPI URLs
67     public static final String API_V1_BASE_URL = "/api/v1";
68     public static final String API_GET_CONTROLLER_INFO = "/";
69     public static final String API_ADD_USER = "/new";
70     public static final String API_EVENTS = "/events";
71     public static final String API_DELETE_USER = "";
72     public static final String API_SET_VALUE = "/state";
73     public static final String API_EFFECT = "/effects";
74     public static final String API_RHYTHM_MODE = "/rhythm/rhythmMode";
75
76     // Nanoleaf model IDs and minimum required firmware versions
77     public static final String API_MIN_FW_VER_LIGHTPANELS = "1.5.0";
78     public static final String API_MIN_FW_VER_CANVAS = "1.1.0";
79     public static final String MODEL_ID_LIGHTPANELS = "NL22";
80
81     public static final List<String> MODELS_WITH_TOUCHSUPPORT = Arrays.asList("NL29", "NL42");
82     public static final String DEVICE_TYPE_LIGHTPANELS = "lightPanels";
83     public static final String DEVICE_TYPE_TOUCHSUPPORT = "canvas"; // we need to keep this enum for backward
84                                                                     // compatibility even though not only canvas type
85                                                                     // support touch
86
87     // mDNS discovery service type
88     // see http://forum.nanoleaf.me/docs/openapi#_gf9l5guxt8r0
89     public static final String SERVICE_TYPE = "_nanoleafapi._tcp.local.";
90
91     // Effect/scene name for static color
92     public static final String EFFECT_NAME_STATIC_COLOR = "*Dynamic*";
93
94     // Color channels increase/decrease brightness step size
95     public static final int BRIGHTNESS_STEP_SIZE = 5;
96 }