PDA

View Full Version : insert pause between ir actions



hginspring
August 27th, 2016, 09:41 PM
trying to get my tv ir input to fire twice. i have 2 actions and tried putting a timer in between but it is only changing the input one time

Ron
August 27th, 2016, 09:54 PM
You'll need a macro. Inside the macro you'll need the first IR out, then a "WAIT" action set to 250ms and the last IR out action. Try that if that doesn't work upload your GML (or part thereof) here.

hginspring
August 28th, 2016, 02:40 PM
forgot about the wait action it worked.

two questions :
is there a way to create an action that will play a wave file?

i have created buttons for stations and I would like to display the current program title in a box. Below is the http command that returns the following. What Lua code should I use? I would like to poll every one minute.

This is the command I'm running against my DirecTV receiver - http://<ip>:8080/tv/getProgInfo?major=245

which returns the following information:

"callsign": "TNTHD",
"date": "20071106",
"duration": 3600,
"episodeTitle": "Intern in the Incinerator",
"isOffAir": false,
"isPclocked": 3,
"isPpv": false,
"isRecording": false,
"isVod": false,
"major": 245,
"minor": 65535,
"programId": "5082014",
"rating": "TV-14-D-L-V",
"startTime": 1349794800,
"stationId": 2220257,
"status":
"code": 200,
"commandResult": 0,
"msg": "OK.",
"query": "/tv/getProgInfo?major=245"
,
"title": "Bones"

Ron
August 28th, 2016, 04:42 PM
excellent!

this is untested but probably an approach you can take:



local poller = function()
network.get("http://<ip>:8080/tv/getProgInfo?major=245", function(data)
data = "{" .. data .. "}"
print(data)
table.print(json.decode(data))
end)
end

pollTimer= timer.new(60000, function(t)
print("polling...")
poller()
end)
pollTimer:start()

hginspring
August 28th, 2016, 04:59 PM
is this going to return all data? i just need the title. what action do i use?

also is there a way to create an action that will play a wave file?

Ron
August 28th, 2016, 05:24 PM
Place this in a scripting action and run it on Girder startup. The play way action lives in the system folder.



local poller = function()
network.get("http://<ip>:8080/tv/getProgInfo?major=245", function(data)
data = "{" .. data .. "}"
print(data)
local d = json.decode(data)
print(d.episodeTitle)
end)
end

pollTimer= timer.new(60000, function(t)
print("polling...")
poller()
end)
pollTimer:start()

hginspring
August 28th, 2016, 06:29 PM
thanks ron. how do i display on net remote?