|
| 1 | +/* |
| 2 | + * Copyright (c) 2010-2025 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 | + |
| 14 | +package org.openhab.binding.mqtt.awtrixlight.internal; |
| 15 | + |
| 16 | +import static org.openhab.binding.mqtt.MqttBindingConstants.BINDING_ID; |
| 17 | + |
| 18 | +import java.util.Set; |
| 19 | + |
| 20 | +import org.eclipse.jdt.annotation.NonNullByDefault; |
| 21 | +import org.openhab.core.thing.ThingTypeUID; |
| 22 | + |
| 23 | +/** |
| 24 | + * The {@link AwtrixLightBindingConstants} class defines common constants, which are |
| 25 | + * used across the whole binding. |
| 26 | + * |
| 27 | + * @author Thomas Lauterbach - Initial contribution |
| 28 | + */ |
| 29 | +@NonNullByDefault |
| 30 | +public class AwtrixLightBindingConstants { |
| 31 | + |
| 32 | + // List of all Thing Type UIDs |
| 33 | + public static final ThingTypeUID THING_TYPE_APP = new ThingTypeUID(BINDING_ID, "awtrix-app"); |
| 34 | + public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "awtrix-clock"); |
| 35 | + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Set.of(THING_TYPE_APP, THING_TYPE_BRIDGE); |
| 36 | + |
| 37 | + // Matrix Size |
| 38 | + public static final int SCREEN_HEIGHT = 8; |
| 39 | + public static final int SCREEN_WIDTH = 32; |
| 40 | + |
| 41 | + // Clock Properties |
| 42 | + public static final String PROP_APPID = "appid"; |
| 43 | + public static final String PROP_APPLOCKTIMEOUT = "appLockTimeout"; |
| 44 | + public static final String PROP_APPNAME = "appname"; |
| 45 | + public static final String PROP_APP_CONTROLLABLE = "useButtons"; |
| 46 | + public static final String PROP_BASETOPIC = "basetopic"; |
| 47 | + public static final String PROP_DISCOVERDEFAULT = "discoverDefaultApps"; |
| 48 | + public static final String PROP_FIRMWARE = "firmware"; |
| 49 | + public static final String PROP_UNIQUEID = "uniqueId"; |
| 50 | + public static final String PROP_VENDOR = "vendor"; |
| 51 | + |
| 52 | + // Clock Topics |
| 53 | + public static final String TOPIC_BASE = "awtrix"; |
| 54 | + public static final String TOPIC_BUTLEFT = "/stats/buttonLeft"; |
| 55 | + public static final String TOPIC_BUTRIGHT = "/stats/buttonRight"; |
| 56 | + public static final String TOPIC_BUTSELECT = "/stats/buttonSelect"; |
| 57 | + public static final String TOPIC_INDICATOR1 = "/indicator1"; |
| 58 | + public static final String TOPIC_INDICATOR2 = "/indicator2"; |
| 59 | + public static final String TOPIC_INDICATOR3 = "/indicator3"; |
| 60 | + public static final String TOPIC_NOTIFY = "/notify"; |
| 61 | + public static final String TOPIC_POWER = "/power"; |
| 62 | + public static final String TOPIC_REBOOT = "/reboot"; |
| 63 | + public static final String TOPIC_RTTTL = "/rtttl"; |
| 64 | + public static final String TOPIC_SCREEN = "/screen"; |
| 65 | + public static final String TOPIC_SEND_SCREEN = "/sendscreen"; |
| 66 | + public static final String TOPIC_SETTINGS = "/settings"; |
| 67 | + public static final String TOPIC_SLEEP = "/sleep"; |
| 68 | + public static final String TOPIC_SOUND = "/sound"; |
| 69 | + public static final String TOPIC_STATS = "/stats"; |
| 70 | + public static final String TOPIC_STATS_CURRENT_APP = "/stats/currentApp"; |
| 71 | + public static final String TOPIC_SWITCH = "/switch"; |
| 72 | + public static final String TOPIC_UPGRADE = "/doupdate"; |
| 73 | + |
| 74 | + // Stats fields |
| 75 | + public static final String FIELD_BRIDGE_APP = "app"; |
| 76 | + public static final String FIELD_BRIDGE_BATTERY = "bat"; |
| 77 | + public static final String FIELD_BRIDGE_BATTERY_RAW = "bat_raw"; |
| 78 | + public static final String FIELD_BRIDGE_BRIGHTNESS = "bri"; |
| 79 | + public static final String FIELD_BRIDGE_FIRMWARE = "version"; |
| 80 | + public static final String FIELD_BRIDGE_HUMIDITY = "hum"; |
| 81 | + public static final String FIELD_BRIDGE_INDICATOR1 = "indicator1"; |
| 82 | + public static final String FIELD_BRIDGE_INDICATOR2 = "indicator2"; |
| 83 | + public static final String FIELD_BRIDGE_INDICATOR3 = "indicator3"; |
| 84 | + public static final String FIELD_BRIDGE_INDICATOR1_COLOR = "indicator1-color"; |
| 85 | + public static final String FIELD_BRIDGE_INDICATOR2_COLOR = "indicator2-color"; |
| 86 | + public static final String FIELD_BRIDGE_INDICATOR3_COLOR = "indicator3-color"; |
| 87 | + public static final String FIELD_BRIDGE_LDR_RAW = "ldr_raw"; |
| 88 | + public static final String FIELD_BRIDGE_LUX = "lux"; |
| 89 | + public static final String FIELD_BRIDGE_MATRIX = "matrix"; |
| 90 | + public static final String FIELD_BRIDGE_MESSAGES = "messages"; |
| 91 | + public static final String FIELD_BRIDGE_RAM = "ram"; |
| 92 | + public static final String FIELD_BRIDGE_TEMPERATURE = "temp"; |
| 93 | + public static final String FIELD_BRIDGE_TYPE = "type"; |
| 94 | + public static final String FIELD_BRIDGE_UID = "uid"; |
| 95 | + public static final String FIELD_BRIDGE_UPTIME = "uptime"; |
| 96 | + public static final String FIELD_BRIDGE_WIFI_SIGNAL = "wifi_signal"; |
| 97 | + |
| 98 | + // Settings fields |
| 99 | + public static final String FIELD_BRIDGE_SET_APP_TIME = "ATIME"; |
| 100 | + public static final String FIELD_BRIDGE_SET_AUTO_BRIGHTNESS = "ABRI"; |
| 101 | + public static final String FIELD_BRIDGE_SET_AUTO_TRANSITION = "ATRANS"; |
| 102 | + public static final String FIELD_BRIDGE_SET_BLOCK_KEYS = "BLOCKN"; |
| 103 | + public static final String FIELD_BRIDGE_SET_BRIGHTNESS = "BRI"; |
| 104 | + public static final String FIELD_BRIDGE_SET_DISPLAY = "MATP"; |
| 105 | + public static final String FIELD_BRIDGE_SET_MUTE = "SOUND"; |
| 106 | + public static final String FIELD_BRIDGE_SET_SCROLL_SPEED = "SSPEED"; |
| 107 | + public static final String FIELD_BRIDGE_SET_TEXT_COLOR = "TCOL"; |
| 108 | + public static final String FIELD_BRIDGE_SET_TRANS_EFFECT = "TEFF"; |
| 109 | + public static final String FIELD_BRIDGE_SET_TRANS_SPEED = "TSPEED"; |
| 110 | + |
| 111 | + // Apps |
| 112 | + public static final String BASE_APP_TOPIC = "/custom"; |
| 113 | + public static final String[] DEFAULT_APPS = { "Time", "Date", "Temperature", "Humidity", "Battery" }; |
| 114 | + |
| 115 | + // Common Channels |
| 116 | + public static final String CHANNEL_BUTLEFT = "button-left"; |
| 117 | + public static final String CHANNEL_BUTRIGHT = "button-right"; |
| 118 | + public static final String CHANNEL_BUTSELECT = "button-select"; |
| 119 | + |
| 120 | + // Clock Channels |
| 121 | + public static final String CHANNEL_APP = "app"; |
| 122 | + public static final String CHANNEL_AUTO_BRIGHTNESS = "auto-brightness"; |
| 123 | + public static final String CHANNEL_BATTERY = "battery-level"; |
| 124 | + public static final String CHANNEL_BRIGHTNESS = "brightness"; |
| 125 | + public static final String CHANNEL_DISPLAY = "display"; |
| 126 | + public static final String CHANNEL_HUMIDITY = "humidity"; |
| 127 | + public static final String CHANNEL_INDICATOR1 = "indicator-1"; |
| 128 | + public static final String CHANNEL_INDICATOR2 = "indicator-2"; |
| 129 | + public static final String CHANNEL_INDICATOR3 = "indicator-3"; |
| 130 | + public static final String CHANNEL_LOW_BATTERY = "low-battery"; |
| 131 | + public static final String CHANNEL_LUX = "lux"; |
| 132 | + public static final String CHANNEL_RSSI = "rssi"; |
| 133 | + public static final String CHANNEL_RTTTL = "rtttl"; |
| 134 | + public static final String CHANNEL_SCREEN = "screen"; |
| 135 | + public static final String CHANNEL_SOUND = "sound"; |
| 136 | + public static final String CHANNEL_TEMPERATURE = "temperature"; |
| 137 | + |
| 138 | + // App Channels |
| 139 | + public static final String CHANNEL_ACTIVE = "active"; |
| 140 | + public static final String CHANNEL_AUTOSCALE = "autoscale"; |
| 141 | + public static final String CHANNEL_BACKGROUND = "background"; |
| 142 | + public static final String CHANNEL_BAR = "bar"; |
| 143 | + public static final String CHANNEL_BLINK_TEXT = "blink-text"; |
| 144 | + public static final String CHANNEL_CENTER = "center"; |
| 145 | + public static final String CHANNEL_COLOR = "color"; |
| 146 | + public static final String CHANNEL_DURATION = "duration"; |
| 147 | + public static final String CHANNEL_EFFECT = "effect"; |
| 148 | + public static final String CHANNEL_EFFECT_BLEND = "effect-blend"; |
| 149 | + public static final String CHANNEL_EFFECT_PALETTE = "effect-palette"; |
| 150 | + public static final String CHANNEL_EFFECT_SPEED = "effect-speed"; |
| 151 | + public static final String CHANNEL_FADE_TEXT = "fade-text"; |
| 152 | + public static final String CHANNEL_GRADIENT_COLOR = "gradient-color"; |
| 153 | + public static final String CHANNEL_ICON = "icon"; |
| 154 | + public static final String CHANNEL_LIFETIME = "lifetime"; |
| 155 | + public static final String CHANNEL_LIFETIME_MODE = "lifetime-mode"; |
| 156 | + public static final String CHANNEL_LINE = "line"; |
| 157 | + public static final String CHANNEL_OVERLAY = "overlay"; |
| 158 | + public static final String CHANNEL_PROGRESS = "progress"; |
| 159 | + public static final String CHANNEL_PROGRESSC = "progress-color"; |
| 160 | + public static final String CHANNEL_PROGRESSBC = "progress-background"; |
| 161 | + public static final String CHANNEL_PUSH_ICON = "push-icon"; |
| 162 | + public static final String CHANNEL_RAINBOW = "rainbow"; |
| 163 | + public static final String CHANNEL_REPEAT = "repeat"; |
| 164 | + public static final String CHANNEL_RESET = "reset"; |
| 165 | + public static final String CHANNEL_SCROLLSPEED = "scroll-speed"; |
| 166 | + public static final String CHANNEL_TEXT = "text"; |
| 167 | + public static final String CHANNEL_TEXTCASE = "text-case"; |
| 168 | + public static final String CHANNEL_TEXT_OFFSET = "text-offset"; |
| 169 | + public static final String CHANNEL_TOP_TEXT = "top-text"; |
| 170 | + |
| 171 | + public static final String PUSH_ICON_OPTION_0 = "STATIC"; |
| 172 | + public static final String PUSH_ICON_OPTION_1 = "PUSHOUT"; |
| 173 | + public static final String PUSH_ICON_OPTION_2 = "PUSHOUTRETURN"; |
| 174 | +} |
0 commit comments