<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta name="Generator" content="Zarafa WebAccess v7.1.1-37812">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>RE: [mythtv-users] New Sky+ App - control Sky box via tcp/ip network</title>
  <style type="text/css">
      body
      {
        font-family: Arial, Verdana, Sans-Serif ! important;
        font-size: 12px;
        padding: 5px 5px 5px 5px;
        margin: 0px;
        border-style: none;
        background-color: #ffffff;
      }

      p, ul, li
      {
        margin-top: 0px;
        margin-bottom: 0px;
      }
  </style>
</head>
<body>
<blockquote style="border-left: 2px solid #325FBA; padding-left: 5px;margin-left:5px;">-----Original message-----<br /><strong>From:</strong>        Michael Watson &lt;michael@thewatsonfamily.id.au&gt;<br /><strong>Sent:</strong>        Fri 14-12-2012 20:49<br /><strong>Subject:</strong>        Re: [mythtv-users] New Sky+ App - control Sky box via tcp/ip network<br /><strong>To:</strong>        mythtv-users@mythtv.org; <br />Not a Problem, happy to assist. &nbsp; I am by no means an expert in python <br />either, but if you need help with the error handling and checking of <br />current channel, let me know. I will need an example of the data <br />returned after a successful channel change, and after a change when its <br />already on that channel. &nbsp;I found the code to query the current channel. <br />but it looks a bit vague.<br /><br />Current playing or current channel is returned by:<br />SkyControl SkyPlay GetMediaInfo<br />Set InstanceID value to: 0<br /><br />CurrentURI : xsi://17FC<br />This indicates channel ITV1 Meridian South or<br />CurrentURI : file://pvr/29004438<br />in the case of a recording.<br /><br /></blockquote><p>Yes, I&#39;ve managed to amend the script now so that it first checks (using GetMediaInfo) to see what is showing on the Sky box, if the CurrentURI line contains a match for the hex code of the channel we&#39;re changing to, the script exits. I had to write the response.read() data into a file before I could search for the value - I&#39;m sure there&#39;s probably a more efficient way of achieving this, but hey - it works!</p><p>&nbsp;</p><p>I&#39;ve attached the scipt and the channel data file (which I now store in /etc/mythtv/sky_channel_guide.txt) just in case anyone else might find it useful. It&#39;s not particularly neat and tidy (unlike your original), so hopefully people won&#39;t look too closely at it and give me a hard time.</p><p>&nbsp;</p><p>Thanks again for all your help.</p><p>&nbsp;</p><p>Regards,</p><p>Dave.</p>
</body>
</html>