[mythtv-users] How to check if a tuner is in use

Hika van den Hoven hikavdh at gmail.com
Wed Oct 15 18:28:27 UTC 2014


Hoi Bill,

Tuesday, October 14, 2014, 12:05:37 AM, you wrote:

> On 10/13/2014 04:28 PM, Hika van den Hoven wrote:
> ...
>> I saw, only your 'Inputs/Input' queries are not there with me.
>> (DisplayName, ScheduleOrder and LiveTVOrder)
>> How do I interpret the status codes.
>> I saw 0 = inactive, 7 = recording and -1 = Not connected.

> Unfortunately, for now you need to read the source and see
> that the enum starts at -1. But for your case, if the value
> is anything other than 0, the tuner isn't available.

> There's work in progress to change the values to translated
> text, so something meaningful (and in your chosen language
> would print. The change would be seen in 0.28 at best.

I've been fiddling around with your python script and already learned
a lot about python. I am trying to let it give the state of just one
card. I added an argument for the videodevice defaulting to
/dev/video0 and then get the id from the database. I also let the
hostname default to the local hostname:

if args.host:
        host = args.host
else:
        host = socket.gethostname()

Now I can't get the filtering of the output from the webpage. I tried:

for element in response.findall('Encoders/Encoder'):
        if element.findtext('Id') == cardid:
                print '%s' % (element.findtext('State'))

and

for element in response.findall('Encoders/Encoder'):
        id=element.findtext('Id')
        state=element.findtext('State')
        if id == cardid:
                print '%s' % (state)

but get nothing. What am I doing wrong?

Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens



More information about the mythtv-users mailing list