Ideas on why I can't edit DirecTV actions?

Posted on
Mon Dec 22, 2014 8:55 pm
ckeyes888 offline
Posts: 2196
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Ideas on why I can't edit DirecTV actions?

Here's one I tried:

Code: Select all
#! /usr/bin/env python2.5
# -*- coding: utf-8 -*-

import simplejson
import urllib2

DTVIP = "192.168.1.28"
url = "http://%s:8080/tv/getTuned?" % DTVIP
f = urllib2.urlopen(url)
simplejson_string = f.read()
f.close()
parsed_simplejson = simplejson.loads(simplejson_string)

try:
   programTitle = parsed_simplejson['title']
   indigo.variable.updateValue(1708209973, programTitle)
except:
   indigo.variable.updateValue(1708209973, " ")
try:
   majorCh = parsed_simplejson['major']
   indigo.variable.updateValue(564695813, majorCh)
except:
   indigo.variable.updateValue(564695813, " ")


The return is always blank, or whatever I may type into the "except".
callsign and a few others will work but not major.

What's odd is that they all log just fine using your original script.

Thanks,

Carl

Posted on
Mon Dec 22, 2014 9:30 pm
DaveL17 offline
User avatar
Posts: 5528
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Ideas on why I can't edit DirecTV actions?

Hi Carl - try wrapping it in a string method:

Code: Select all
majorCh = str(parsed_simplejson['major'])

Note: I'm crazy swamped IRL and it may be a while before I can respond to messages or bug reports. Thanks for your patience.
-----
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Dec 22, 2014 10:41 pm
ckeyes888 offline
Posts: 2196
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Ideas on why I can't edit DirecTV actions?

Nailed it, works great.

Thanks again!

Carl

Posted on
Tue Dec 23, 2014 3:44 am
DaveL17 offline
User avatar
Posts: 5528
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Ideas on why I can't edit DirecTV actions?

ckeyes888 wrote:
Nailed it, works great.

Thanks again!

Carl

Good deal. Glad it worked.

Enjoy!
Dave

Note: I'm crazy swamped IRL and it may be a while before I can respond to messages or bug reports. Thanks for your patience.
-----
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 1 guest