[nanoleaf] add LONG_PRESSED tap detection (#13865)
* [nanoleaf] add LONG_PRESSED tap detection Signed-off-by: Stefan Höhn <stefan.hoehn@nfon.com>pull/13856/head
parent
35f416da9a
commit
4c93125723
|
@ -156,10 +156,10 @@ The controller bridge has the following channels:
|
||||||
|
|
||||||
A lightpanel thing has the following channels:
|
A lightpanel thing has the following channels:
|
||||||
|
|
||||||
| Channel | Type | Description | Read Only |
|
| Channel | Type | Description | Read Only |
|
||||||
|---------------------|-----------|----------------------------------------------------------------------------------------------------------|-----------|
|
|---------------------|-----------|-----------------------------------------------------------------------------------------------------------------------|-----------|
|
||||||
| color | Color | Color of the individual light panel | No |
|
| 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 |
|
| 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.
|
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*.
|
For example, brightness of *all* panels at once can be controlled by defining a dimmer item for the color channel of the *controller thing*.
|
||||||
|
|
|
@ -270,7 +270,7 @@ public class NanoleafPanelHandler extends BaseThingHandler {
|
||||||
/**
|
/**
|
||||||
* Apply the gesture to the panel
|
* 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) {
|
public void updatePanelGesture(int gesture) {
|
||||||
switch (gesture) {
|
switch (gesture) {
|
||||||
|
@ -280,6 +280,9 @@ public class NanoleafPanelHandler extends BaseThingHandler {
|
||||||
case 1:
|
case 1:
|
||||||
triggerChannel(CHANNEL_PANEL_TAP, CommonTriggerEvents.DOUBLE_PRESSED);
|
triggerChannel(CHANNEL_PANEL_TAP, CommonTriggerEvents.DOUBLE_PRESSED);
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
triggerChannel(CHANNEL_PANEL_TAP, CommonTriggerEvents.LONG_PRESSED);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue