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 whether you accept or reject these cookies being set.

Schedule on/off
#1
Hello,

How can i make a button on my visualization that turn a spesific schedule on and off?
Reply
#2
Hi.

You can use this script to get your function.

-- Enables / Disables schedulers

name = 'Scheduler 1'

active = event.getvalue()



db:update('schedulers', { active = toboolean(active) }, { name = name })

clearschedulers()



--------------end---------------------

--------------put this in common functions---------------------

function clearschedulers()

  local files = io.ls('/tmp')

  for _, file in ipairs(files) do

    if file:find('lm-scheduler-', 1, true) then

      os.remove('/tmp/' .. file)

    end

  end

end
---------------------end-------------------------------------------
Reply
#3
Thanks for your reply, I'm new to this scripting so where do i need to change the script to make it fit my Schedule name?
Reply
#4
Change Scheduler 1 to your name.
Reply
#5
(02.05.2019, 05:39)Rauschentofft Wrote: Change Scheduler 1 to your name.

Thanks, it works!  Smile
Reply


Forum Jump: