]> git.basschouten.com Git - openhab-addons.git/commitdiff
[nanoleaf] add LONG_PRESSED tap detection (#13865)
authorstefan-hoehn <mail@stefanhoehn.com>
Wed, 7 Dec 2022 04:49:04 +0000 (05:49 +0100)
committerGitHub <noreply@github.com>
Wed, 7 Dec 2022 04:49:04 +0000 (05:49 +0100)
* [nanoleaf] add LONG_PRESSED tap detection

Signed-off-by: Stefan Höhn <stefan.hoehn@nfon.com>
bundles/org.openhab.binding.nanoleaf/README.md
bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java

index 39816999e6d693cefc2768eaac9ea6d49cdd1013..c7220da82f6a35b6b62b20c41963374aba8b3a9e 100644 (file)
@@ -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*.
index 995eb8a3479e327a292febff790e0adf1d6506bf..60b66196c6c9e369dfc89b149e17c98c1350b314 100644 (file)
@@ -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;
         }
     }