]> git.basschouten.com Git - openhab-addons.git/blob
eb8d3bc635b529e0de359c14c8525717e48c937c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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 org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.thing.ThingTypeUID;
17
18 /**
19  * The {@link NanoleafBindingConstants} class defines common constants, which are
20  * used across the whole binding.
21  *
22  * @author Martin Raepple - Initial contribution
23  */
24 @NonNullByDefault
25 public class NanoleafBindingConstants {
26
27     private static final String BINDING_ID = "nanoleaf";
28
29     // List of all Thing Type UIDs
30     public static final ThingTypeUID THING_TYPE_CONTROLLER = new ThingTypeUID(BINDING_ID, "controller");
31     public static final ThingTypeUID THING_TYPE_LIGHT_PANEL = new ThingTypeUID(BINDING_ID, "lightpanel");
32
33     // Controller configuration settings
34     public static final String CONFIG_ADDRESS = "address";
35     public static final String CONFIG_PORT = "port";
36     public static final String CONFIG_AUTH_TOKEN = "authToken";
37     public static final String CONFIG_DEVICE_TYPE_CANVAS = "canvas";
38     public static final String CONFIG_DEVICE_TYPE_LIGHTPANELS = "lightPanels";
39
40     // Panel configuration settings
41     public static final String CONFIG_PANEL_ID = "id";
42
43     // List of controller channels
44     public static final String CHANNEL_POWER = "power";
45     public static final String CHANNEL_COLOR = "color";
46     public static final String CHANNEL_COLOR_TEMPERATURE = "colorTemperature";
47     public static final String CHANNEL_COLOR_TEMPERATURE_ABS = "colorTemperatureAbs";
48     public static final String CHANNEL_COLOR_MODE = "colorMode";
49     public static final String CHANNEL_EFFECT = "effect";
50     public static final String CHANNEL_RHYTHM_STATE = "rhythmState";
51     public static final String CHANNEL_RHYTHM_ACTIVE = "rhythmActive";
52     public static final String CHANNEL_RHYTHM_MODE = "rhythmMode";
53     public static final String CHANNEL_PANEL_LAYOUT = "panelLayout";
54
55     // List of light panel channels
56     public static final String CHANNEL_PANEL_COLOR = "panelColor";
57     public static final String CHANNEL_PANEL_SINGLE_TAP = "singleTap";
58     public static final String CHANNEL_PANEL_DOUBLE_TAP = "doubleTap";
59
60     // Nanoleaf OpenAPI URLs
61     public static final String API_V1_BASE_URL = "/api/v1";
62     public static final String API_GET_CONTROLLER_INFO = "/";
63     public static final String API_ADD_USER = "/new";
64     public static final String API_EVENTS = "/events";
65     public static final String API_DELETE_USER = "";
66     public static final String API_SET_VALUE = "/state";
67     public static final String API_EFFECT = "/effects";
68     public static final String API_RHYTHM_MODE = "/rhythm/rhythmMode";
69
70     // Nanoleaf model IDs and minimum required firmware versions
71     public static final String API_MIN_FW_VER_LIGHTPANELS = "1.5.0";
72     public static final String API_MIN_FW_VER_CANVAS = "1.1.0";
73     public static final String MODEL_ID_LIGHTPANELS = "NL22";
74     public static final String MODEL_ID_CANVAS = "NL29";
75     public static final String DEVICE_TYPE_LIGHTPANELS = "lightPanels";
76     public static final String DEVICE_TYPE_CANVAS = "canvas";
77
78     // mDNS discovery service type
79     // see http://forum.nanoleaf.me/docs/openapi#_gf9l5guxt8r0
80     public static final String SERVICE_TYPE = "_nanoleafapi._tcp.local.";
81
82     // Effect/scene name for static color
83     public static final String EFFECT_NAME_STATIC_COLOR = "*Dynamic*";
84
85     // Color channels increase/decrease brightness step size
86     public static final int BRIGHTNESS_STEP_SIZE = 5;
87 }