From 4c931257238f28e51f4cced4c853c523ac7ab612 Mon Sep 17 00:00:00 2001 From: stefan-hoehn Date: Wed, 7 Dec 2022 05:49:04 +0100 Subject: [PATCH] [nanoleaf] add LONG_PRESSED tap detection (#13865) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [nanoleaf] add LONG_PRESSED tap detection Signed-off-by: Stefan Höhn --- bundles/org.openhab.binding.nanoleaf/README.md | 8 ++++---- .../nanoleaf/internal/handler/NanoleafPanelHandler.java | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.nanoleaf/README.md b/bundles/org.openhab.binding.nanoleaf/README.md index 39816999e..c7220da82 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 995eb8a34..60b66196c 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; } }