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.lifx.internal;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.lifx.internal.fields.HSBK;
19 import org.openhab.core.library.types.HSBType;
20 import org.openhab.core.library.types.PercentType;
21 import org.openhab.core.thing.ThingTypeUID;
22 import org.openhab.core.thing.type.ChannelTypeUID;
25 * The {@link LifxBindingConstants} class defines common constants, which are used across
28 * @author Dennis Nobel - Initial contribution
29 * @author Wouter Born - Added packet interval, power on brightness constants
32 public class LifxBindingConstants {
34 public static final String BINDING_ID = "lifx";
36 // The LIFX LAN Protocol Specification states that lights can process up to 20 messages per second, not more.
37 public static final long PACKET_INTERVAL = 50;
40 public static final int BROADCAST_PORT = 56700;
41 public static final int UNICAST_PORT = 56700;
43 // Minimum and maximum of MultiZone light indices
44 public static final int MIN_ZONE_INDEX = 0;
45 public static final int MAX_ZONE_INDEX = 255;
47 // Fallback light state defaults
48 public static final HSBK DEFAULT_COLOR = new HSBK(HSBType.WHITE, 3000);
49 public static final PercentType DEFAULT_BRIGHTNESS = PercentType.HUNDRED;
51 // List of all Channel IDs
52 public static final String CHANNEL_ABS_TEMPERATURE = "abstemperature";
53 public static final String CHANNEL_ABS_TEMPERATURE_ZONE = "abstemperaturezone";
54 public static final String CHANNEL_BRIGHTNESS = "brightness";
55 public static final String CHANNEL_COLOR = "color";
56 public static final String CHANNEL_COLOR_ZONE = "colorzone";
57 public static final String CHANNEL_EFFECT = "effect";
58 public static final String CHANNEL_HEV_CYCLE = "hevcycle";
59 public static final String CHANNEL_INFRARED = "infrared";
60 public static final String CHANNEL_SIGNAL_STRENGTH = "signalstrength";
61 public static final String CHANNEL_TEMPERATURE = "temperature";
62 public static final String CHANNEL_TEMPERATURE_ZONE = "temperaturezone";
64 // List of all Channel Type UIDs
65 public static final ChannelTypeUID CHANNEL_TYPE_BRIGHTNESS = new ChannelTypeUID(BINDING_ID, CHANNEL_BRIGHTNESS);
66 public static final ChannelTypeUID CHANNEL_TYPE_COLOR = new ChannelTypeUID(BINDING_ID, CHANNEL_COLOR);
67 public static final ChannelTypeUID CHANNEL_TYPE_EFFECT = new ChannelTypeUID(BINDING_ID, CHANNEL_EFFECT);
68 public static final ChannelTypeUID CHANNEL_TYPE_HEV_CYCLE = new ChannelTypeUID(BINDING_ID, CHANNEL_HEV_CYCLE);
69 public static final ChannelTypeUID CHANNEL_TYPE_INFRARED = new ChannelTypeUID(BINDING_ID, CHANNEL_INFRARED);
70 public static final ChannelTypeUID CHANNEL_TYPE_TEMPERATURE = new ChannelTypeUID(BINDING_ID, CHANNEL_TEMPERATURE);
72 // List of options for effect channel
73 public static final String CHANNEL_TYPE_EFFECT_OPTION_OFF = "off";
74 public static final String CHANNEL_TYPE_EFFECT_OPTION_MORPH = "morph";
75 public static final String CHANNEL_TYPE_EFFECT_OPTION_FLAME = "flame";
77 // Config property for the LIFX device id
78 public static final String CONFIG_PROPERTY_DEVICE_ID = "deviceId";
79 public static final String CONFIG_PROPERTY_FADETIME = "fadetime";
81 // Config property for channel configuration
82 public static final String CONFIG_PROPERTY_HEV_CYCLE_DURATION = "hevCycleDuration";
83 public static final String CONFIG_PROPERTY_EFFECT_FLAME_SPEED = "effectFlameSpeed";
84 public static final String CONFIG_PROPERTY_EFFECT_MORPH_SPEED = "effectMorphSpeed";
85 public static final String CONFIG_PROPERTY_POWER_ON_BRIGHTNESS = "powerOnBrightness";
86 public static final String CONFIG_PROPERTY_POWER_ON_COLOR = "powerOnColor";
87 public static final String CONFIG_PROPERTY_POWER_ON_TEMPERATURE = "powerOnTemperature";
90 public static final String PROPERTY_HOST = "host";
91 public static final String PROPERTY_HOST_VERSION = "hostVersion";
92 public static final String PROPERTY_MAC_ADDRESS = "macAddress";
93 public static final String PROPERTY_PRODUCT_ID = "productId";
94 public static final String PROPERTY_PRODUCT_NAME = "productName";
95 public static final String PROPERTY_PRODUCT_VERSION = "productVersion";
96 public static final String PROPERTY_VENDOR_ID = "vendorId";
97 public static final String PROPERTY_VENDOR_NAME = "vendorName";
98 public static final String PROPERTY_WIFI_VERSION = "wifiVersion";
99 public static final String PROPERTY_ZONES = "zones";
101 // List of all Thing Type UIDs
102 public static final ThingTypeUID THING_TYPE_COLORLIGHT = new ThingTypeUID(BINDING_ID, "colorlight");
103 public static final ThingTypeUID THING_TYPE_COLORHEVLIGHT = new ThingTypeUID(BINDING_ID, "colorhevlight");
104 public static final ThingTypeUID THING_TYPE_COLORIRLIGHT = new ThingTypeUID(BINDING_ID, "colorirlight");
105 public static final ThingTypeUID THING_TYPE_COLORMZLIGHT = new ThingTypeUID(BINDING_ID, "colormzlight");
106 public static final ThingTypeUID THING_TYPE_TILELIGHT = new ThingTypeUID(BINDING_ID, "tilelight");
107 public static final ThingTypeUID THING_TYPE_WHITELIGHT = new ThingTypeUID(BINDING_ID, "whitelight");
109 public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Set.of(THING_TYPE_COLORLIGHT,
110 THING_TYPE_COLORHEVLIGHT, THING_TYPE_COLORIRLIGHT, THING_TYPE_COLORMZLIGHT, THING_TYPE_TILELIGHT,
111 THING_TYPE_WHITELIGHT);