From: stefan-hoehn Date: Wed, 7 Dec 2022 04:49:04 +0000 (+0100) Subject: [nanoleaf] add LONG_PRESSED tap detection (#13865) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=4c931257238f28e51f4cced4c853c523ac7ab612;p=openhab-addons.git [nanoleaf] add LONG_PRESSED tap detection (#13865) * [nanoleaf] add LONG_PRESSED tap detection Signed-off-by: Stefan Höhn --- diff --git a/bundles/org.openhab.binding.nanoleaf/README.md b/bundles/org.openhab.binding.nanoleaf/README.md index 39816999e6..c7220da82f 100644 --- a/bundles/org.openhab.binding.nanoleaf/README.md +++ b/bundles/org.openhab.binding.nanoleaf/README.md @@ -156,10 +156,10 @@ The controller bridge has the following channels: A lightpanel thing has the following channels: -| Channel | Type | Description | Read Only | -|---------------------|-----------|----------------------------------------------------------------------------------------------------------|-----------| -| color | Color | Color of the individual light panel | No | -| tap | Trigger | [Canvas / Shapes Only] Sends events of gestures. SHORT_PRESSED and DOUBLE_PRESSED events are supported. | Yes | +| Channel | Type | Description | Read Only | +|---------------------|-----------|-----------------------------------------------------------------------------------------------------------------------|-----------| +| color | Color | Color of the individual light panel | No | +| tap | Trigger | [Canvas / Shapes Only] Sends events of gestures. SHORT_PRESSED, LONG_PRESSED and DOUBLE_PRESSED events are supported. | Yes | The color channels support full color control with hue, saturation and brightness values. For example, brightness of *all* panels at once can be controlled by defining a dimmer item for the color channel of the *controller thing*. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java index 995eb8a347..60b66196c6 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java @@ -270,7 +270,7 @@ public class NanoleafPanelHandler extends BaseThingHandler { /** * Apply the gesture to the panel * - * @param gesture Only 0=single tap and 1=double tap are supported + * @param gesture Only 0=single tap, 1=double tap and 6=long press are supported */ public void updatePanelGesture(int gesture) { switch (gesture) { @@ -280,6 +280,9 @@ public class NanoleafPanelHandler extends BaseThingHandler { case 1: triggerChannel(CHANNEL_PANEL_TAP, CommonTriggerEvents.DOUBLE_PRESSED); break; + case 6: + triggerChannel(CHANNEL_PANEL_TAP, CommonTriggerEvents.LONG_PRESSED); + break; } }