PDA

View Full Version : OnNoActivity Action..?



VicVonDoom
August 27th, 2009, 11:02 AM
Hi,

I'm trying to get a device to jump to a page displaying a clock if no activity has occured with n minutes/hours etc.. (same as a screensaver - but using a page jump)

Is there such a fuction in NR that watches for button presses (i def do not want to do it the other way & add a restart timer action to each button!!!)

Is it possible or another pipe dream of mine.....

Cheers, Jim

kwaugh
August 27th, 2009, 11:31 AM
Not sure if it's what you're looking for. I call this routine every 10 seconds:

function screensleepcheck()
print("time to sleep?")
timesincelast = NetRemote.GetVariable("Utility.TimeSinceLastAction") + 0
minb4sleep = 30
chktime = minb4sleep * 60 * 1000
if (timesincelast > chktime) then
NetRemote.GoDevice('Sleep','Sleep.Main')
print("yes")
else
print("no")
print(timesincelast)
--do nothing
end
end

VicVonDoom
August 27th, 2009, 11:59 AM
Thats Perfect!