This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

enable disable schedulers
#1
Hi,

is there a way to enable, disable schedulers and scenes with a script like,


value1 = event.getvalue()
if value1 == true then
  schedulers.disable('name')
  scenes.disable('name')
end
Reply
#2
Hi,

You can't enable / disable schedulers by script, but you can create some logic and use a internal object for the scheduler and attach script below to it and create a internal object to set the en/disable state.
Code:
address_en_disable = '32/0/2'
address_output = '1/1/1'

if event.getvalue() == true and grp.getvalue(address_en_disable) == true then
 grp.write(address_output, true)
else
 grp.write(address_output, false)
end

For scenes commands see http://openrb.com/docs/lua.htm#11

BR,

Erwin
Reply
#3
There's an unfinished scheduler control library: https://gist.github.com/jsopenrb/e2eb174...2f633205de

Create new user library called scheduler, then use it in your code like this:
Code:
scheduler = require('user.scheduler')
scheduler.enable('name')

As Erwin mentioned, scene control is already built-in
Reply


Forum Jump: