Announcement

Collapse
No announcement yet.

Control Channel with script via plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Control Channel with script via plugin

    Spud,

    sorry to bug again, but is there a way to call the channel function via a script?

    Im creating a script for for the Kinect plugin and need to pass the channel to the remote device or a function in the plugin. I could pass it via url directly to the directv I guess but that would defeat the use of the plugin

    Let me know if this is possible or you have a better way

    Something like this (not complete just a flow):

    Code:
     
    VSource = hs.GetVar("kinectvar0")
     
    If Vsource = "Fox" Then
      channelnum=4
    ElseIf Vsource = "NBC" Then
      channelnum=5
    ElseIf Vsource = "ABC" Then
      channelnum=8
    ElseIf Vsource = "CBS" Then
    etc...
     
    hs.PluginFunction(DirecTV, "", "Change_Channel", channelnum)


    Thanks,
    Steven G

    #2
    yes that's possible.

    there are two (undocumented) functions available by script:

    Code:
            
    public void SendRemoteKeyCmd(string key)
    public void SendTuneChannelCmd(int channel)
    I will add some examples in the User Guide

    Comment


      #3
      Did you have a chance to update the user guide? Only reason I ask is the User Guide page was updated but I did not find any new information, just wanted to make sure I was not missing it or looking at wrong guide

      Thanks,
      Steven G

      Comment


        #4
        I haven't updated the user guide yet, but here is a simple example script to tune to channel 33:

        Code:
        Sub Main(ByVal parm as object)
            hs.PluginFunction("DirecTV", "", "SendTuneChannelCmd", New Object() {33})    
        End Sub

        Comment


          #5
          That worked thank you

          Steven G

          Comment

          Working...
          X