From 236ec06a7bba1f90625880125dd3da90ebbf89d8 Mon Sep 17 00:00:00 2001 From: mlobstein Date: Tue, 7 May 2024 14:58:39 -0500 Subject: [PATCH] [kaleidescape] Add Buttongrid example and command channel (#16720) Signed-off-by: Michael Lobstein Signed-off-by: Ciprian Pascu --- .../README.md | 4 ++ .../KaleidescapeBindingConstants.java | 1 + .../internal/handler/KaleidescapeHandler.java | 3 ++ .../OH-INF/i18n/kaleidescape.properties | 2 + .../main/resources/OH-INF/thing/channels.xml | 14 +++++++ .../resources/OH-INF/update/instructions.xml | 38 +++++++++++++++++++ 6 files changed, 62 insertions(+) create mode 100644 bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/update/instructions.xml diff --git a/bundles/org.openhab.binding.kaleidescape/README.md b/bundles/org.openhab.binding.kaleidescape/README.md index 46b58d134c9..906a767f6bd 100644 --- a/bundles/org.openhab.binding.kaleidescape/README.md +++ b/bundles/org.openhab.binding.kaleidescape/README.md @@ -3,6 +3,7 @@ This binding now makes it possible to easily integrate almost all of the capabilities of the Kaleidescape control protocol into openHAB. Beyond just integrating playback transport controls, all meta-data provided via the control protocol is made available for display purposes and to use in rules. By using rules, it is possible to control other Things such as lighting, projector lens shift, screen masking, etc. based on events that occur during movie playback. +A simulated remote control is available in BasicUI using the Buttongrid sitemap element described below. Finally, any other command that is supported by the control protocol can be sent to the component through rules. See [Kaleidescape-System-Control-Protocol-Reference-Manual.pdf](https://support.kaleidescape.com/article/Control-Protocol-Reference-Manual) for a reference of available commands. @@ -95,6 +96,7 @@ The following channels are available: | ui#user_defined_event | String | Will contain custom event messages generated by scripts, sent from another component, or system events | | ui#user_input | String | Indicates if the user is being prompted for input, what type of input, and any currently entered characters | | ui#user_input_prompt | String | Indicates user input prompt info and properties currently shown on screen | +| ui#sendcmd | String | Sends a raw command to the Kaleidescape player (WriteOnly) | | -- music channels (not available on Alto and Strato) -- | | music#control | Player | Control Music Playback e.g. play/pause/next/previous/ffward/rewind | | music#repeat | Switch | Controls repeat playback for music | @@ -186,6 +188,7 @@ String z1_Ui_HighlightedSelection "Highlighted Selection: [%s]" { channel="kalei String z1_Ui_UserDefinedEvent "User Defined Event: [%s]" { channel="kaleidescape:player:myzone1:ui#user_defined_event" } String z1_Ui_UserInput "User Input: [%s]" { channel="kaleidescape:player:myzone1:ui#user_input" } String z1_Ui_UserInputPrompt "User Input Prompt[%s]" { channel="kaleidescape:player:myzone1:ui#user_input_prompt" } +String z1_Ui_Sendcmd "Send Command" { channel="kaleidescape:player:myzone1:ui#sendcmd" } // Music Channels (not available on Alto or Strato) Player z1_Music_Control "Music Control" { channel="kaleidescape:player:myzone1:music#control" } @@ -334,6 +337,7 @@ sitemap kaleidescape label="Kaleidescape" { Text item=z1_Music_AlbumHandle icon="zoom" Text item=z1_Music_NowplayHandle icon="zoom" } + Buttongrid label="Kaleidescape Remote" staticIcon=material:tv_remote item=z1_Ui_Sendcmd buttons=[1:1:DETAILS="Info", 1:2:STOP="Stop"=f7:stop, 1:3:PAUSE="Pause"=f7:pause, 2:1:PREVIOUS="Previous"=f7:backward_end_alt, 2:2:PLAY="Play"=f7:play, 2:3:NEXT="Next"=f7:forward_end_alt, 3:1:SCAN_REVERSE="Reverse"=f7:backward, 3:2:KALEIDESCAPE_MENU_TOGGLE="Menu", 3:3:SCAN_FORWARD="Forward"=f7:forward, 4:1:GO_MOVIES="Movies"=f7:film, 4:3:GO_MUSIC="Music"=f7:music_note_2, 4:2:UP="Up"=f7:arrowtriangle_up, 6:2:DOWN="Down"=f7:arrowtriangle_down, 5:1:LEFT="Left"=f7:arrowtriangle_left, 5:3:RIGHT="Right"=f7:arrowtriangle_right, 5:2:SELECT="OK", 7:1:DISC_MENU="Disc Menu", 7:2:INTERMISSION_TOGGLE="Intermission", 7:3:PAGE_UP="Page Up", 8:1:SHUFFLE_COVER_ART="Shuffle", 8:2:GO_NOW_PLAYING="Now Playing", 8:3:PAGE_DOWN="Page Down", 9:1:"KEYBOARD_CHARACTER:1"="1", 9:2:"KEYBOARD_CHARACTER:2"="2", 9:3:"KEYBOARD_CHARACTER:3"="3", 10:1:"KEYBOARD_CHARACTER:4"="4", 10:2:"KEYBOARD_CHARACTER:5"="5", 10:3:"KEYBOARD_CHARACTER:6"="6", 11:1:"KEYBOARD_CHARACTER:7"="7", 11:2:"KEYBOARD_CHARACTER:8"="8", 11:3:"KEYBOARD_CHARACTER:9"="9", 12:1:CANCEL="Cancel", 12:2:"KEYBOARD_CHARACTER:0"="0", 12:3:SELECT="Enter", 13:1:RED="Red", 13:2:GREEN="Green", 13:3:BLUE="Blue", 14:2:YELLOW="Yellow"] } } ``` diff --git a/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/KaleidescapeBindingConstants.java b/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/KaleidescapeBindingConstants.java index 908765c535e..e3ab0fb5b25 100644 --- a/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/KaleidescapeBindingConstants.java +++ b/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/KaleidescapeBindingConstants.java @@ -78,6 +78,7 @@ public class KaleidescapeBindingConstants { public static final String USER_DEFINED_EVENT = "ui#user_defined_event"; public static final String USER_INPUT = "ui#user_input"; public static final String USER_INPUT_PROMPT = "ui#user_input_prompt"; + public static final String CHANNEL_TYPE_SENDCMD = "ui#sendcmd"; public static final String MUSIC = "music#"; public static final String MUSIC_CONTROL = "music#control"; diff --git a/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/handler/KaleidescapeHandler.java b/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/handler/KaleidescapeHandler.java index 51b3e02baf2..a248a92efef 100644 --- a/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/handler/KaleidescapeHandler.java +++ b/bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/handler/KaleidescapeHandler.java @@ -255,6 +255,9 @@ public class KaleidescapeHandler extends BaseThingHandler implements Kaleidescap case MUSIC_CONTROL: handleControlCommand(command); break; + case CHANNEL_TYPE_SENDCMD: + connector.sendCommand(command.toString()); + break; default: logger.debug("Command {} from channel {} failed: unexpected command", command, channel); break; diff --git a/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/i18n/kaleidescape.properties b/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/i18n/kaleidescape.properties index b03fc5a09fb..91bed2e1ef9 100644 --- a/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/i18n/kaleidescape.properties +++ b/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/i18n/kaleidescape.properties @@ -158,6 +158,8 @@ channel-type.kaleidescape.screen_mask.label = Screen Mask channel-type.kaleidescape.screen_mask.description = Provides aspect ratio and masking information for the current video image channel-type.kaleidescape.screen_mask2.label = Screen Mask 2 channel-type.kaleidescape.screen_mask2.description = Provides masking information based on aspect ratio and overscan area +channel-type.kaleidescape.sendcmd.label = Send Command +channel-type.kaleidescape.sendcmd.description = Send a command to the component channel-type.kaleidescape.synopsis.label = Synopsis channel-type.kaleidescape.synopsis.description = A synopsis of the selected Movie channel-type.kaleidescape.title.label = Movie Title diff --git a/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/thing/channels.xml index 713fa99d0ac..f0fb0586f9b 100644 --- a/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/thing/channels.xml @@ -33,6 +33,7 @@ unknown unknown unknown + 1 @@ -67,6 +68,7 @@ unknown unknown unknown + 1 @@ -97,6 +99,7 @@ unknown unknown unknown + 1 @@ -127,6 +130,7 @@ unknown unknown unknown + 1 @@ -167,6 +171,7 @@ + @@ -205,6 +210,7 @@ + @@ -247,6 +253,7 @@ + @@ -793,4 +800,11 @@ + + String + + Send a command to the component + veto + + diff --git a/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/update/instructions.xml new file mode 100644 index 00000000000..1a576ce589f --- /dev/null +++ b/bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/update/instructions.xml @@ -0,0 +1,38 @@ + + + + + + + kaleidescape:sendcmd + + + + + + + + kaleidescape:sendcmd + + + + + + + + kaleidescape:sendcmd + + + + + + + + kaleidescape:sendcmd + + + + +