]> git.basschouten.com Git - openhab-addons.git/commitdiff
[kaleidescape] Add Buttongrid example and command channel (#16720)
authormlobstein <michael.lobstein@gmail.com>
Tue, 7 May 2024 19:58:39 +0000 (14:58 -0500)
committerGitHub <noreply@github.com>
Tue, 7 May 2024 19:58:39 +0000 (21:58 +0200)
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
bundles/org.openhab.binding.kaleidescape/README.md
bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/KaleidescapeBindingConstants.java
bundles/org.openhab.binding.kaleidescape/src/main/java/org/openhab/binding/kaleidescape/internal/handler/KaleidescapeHandler.java
bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/i18n/kaleidescape.properties
bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/thing/channels.xml
bundles/org.openhab.binding.kaleidescape/src/main/resources/OH-INF/update/instructions.xml [new file with mode: 0644]

index 46b58d134c9bcf2def0011dcf94cf5a905213160..906a767f6bdb02cc8affb0a130ed4fa150208d22 100644 (file)
@@ -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"]
     }
 }
 ```
index 908765c535e6e634f6afa3c70224b0125cedbc86..e3ab0fb5b2520f619b44278225ae938b39c8d591 100644 (file)
@@ -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";
index 51b3e02baf2011d34d6d7e22d4934c4501c90374..a248a92efeff401f05c02f07c90f3d3d460a2566 100644 (file)
@@ -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;
index b03fc5a09fb5e4c79f8cd0290cdb56c5de68abed..91bed2e1ef991c1a6130fb16ffe92fa0584a3af6 100644 (file)
@@ -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
index 713fa99d0ac5056bb08530eb2cf07234e80e3fe0..f0fb0586f9bff3983e50acd255d39388de2650a2 100644 (file)
@@ -33,6 +33,7 @@
                        <property name="Control Protocol ID">unknown</property>
                        <property name="System Version">unknown</property>
                        <property name="Protocol Version">unknown</property>
+                       <property name="thingTypeVersion">1</property>
                </properties>
 
                <config-description-ref uri="thing-type:kaleidescape:kaleidescapedevice"/>
@@ -67,6 +68,7 @@
                        <property name="Control Protocol ID">unknown</property>
                        <property name="System Version">unknown</property>
                        <property name="Protocol Version">unknown</property>
+                       <property name="thingTypeVersion">1</property>
                </properties>
 
                <config-description-ref uri="thing-type:kaleidescape:kaleidescapedevice"/>
@@ -97,6 +99,7 @@
                        <property name="Control Protocol ID">unknown</property>
                        <property name="System Version">unknown</property>
                        <property name="Protocol Version">unknown</property>
+                       <property name="thingTypeVersion">1</property>
                </properties>
 
                <config-description-ref uri="thing-type:kaleidescape:kaleidescapedevice"/>
                        <property name="Control Protocol ID">unknown</property>
                        <property name="System Version">unknown</property>
                        <property name="Protocol Version">unknown</property>
+                       <property name="thingTypeVersion">1</property>
                </properties>
 
                <config-description-ref uri="thing-type:kaleidescape:kaleidescapedevice"/>
                        <channel id="user_defined_event" typeId="user_defined_event"/>
                        <channel id="user_input" typeId="user_input"/>
                        <channel id="user_input_prompt" typeId="user_input_prompt"/>
+                       <channel id="sendcmd" typeId="sendcmd"/>
                </channels>
        </channel-group-type>
 
                        <channel id="user_defined_event" typeId="user_defined_event"/>
                        <channel id="user_input" typeId="user_input"/>
                        <channel id="user_input_prompt" typeId="user_input_prompt"/>
+                       <channel id="sendcmd" typeId="sendcmd"/>
                </channels>
        </channel-group-type>
 
                        <channel id="user_defined_event" typeId="user_defined_event"/>
                        <channel id="user_input" typeId="user_input"/>
                        <channel id="user_input_prompt" typeId="user_input_prompt"/>
+                       <channel id="sendcmd" typeId="sendcmd"/>
                </channels>
        </channel-group-type>
 
                <state readOnly="true"/>
        </channel-type>
 
+       <channel-type id="sendcmd" advanced="true">
+               <item-type>String</item-type>
+               <label>Send Command</label>
+               <description>Send a command to the component</description>
+               <autoUpdatePolicy>veto</autoUpdatePolicy>
+       </channel-type>
+
 </thing:thing-descriptions>
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 (file)
index 0000000..1a576ce
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
+       xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
+
+       <thing-type uid="kaleidescape:player">
+               <instruction-set targetVersion="1">
+                       <add-channel id="sendcmd" groupIds="ui">
+                               <type>kaleidescape:sendcmd</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+
+       <thing-type uid="kaleidescape:cinemaone">
+               <instruction-set targetVersion="1">
+                       <add-channel id="sendcmd" groupIds="c1-alto_ui">
+                               <type>kaleidescape:sendcmd</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+
+       <thing-type uid="kaleidescape:alto">
+               <instruction-set targetVersion="1">
+                       <add-channel id="sendcmd" groupIds="c1-alto_ui">
+                               <type>kaleidescape:sendcmd</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+
+       <thing-type uid="kaleidescape:strato">
+               <instruction-set targetVersion="1">
+                       <add-channel id="sendcmd" groupIds="strato_ui">
+                               <type>kaleidescape:sendcmd</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+
+</update:update-descriptions>