diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-15 13:16:40 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-15 13:16:40 +0000 |
commit | 44c93e7caf7e3cef91d8931b1559dd1912e893b7 (patch) | |
tree | 0e01f73dfde8063638332f27acd51e982f1a1a82 /scripts/toy.groovy | |
parent | Don't risk intervals calling themselves (diff) | |
download | toy-44c93e7caf7e3cef91d8931b1559dd1912e893b7.zip |
Pass event name to handler
Diffstat (limited to 'scripts/toy.groovy')
-rw-r--r-- | scripts/toy.groovy | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy index 1cb9672..9e26632 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -207,7 +207,7 @@ def execEvents = { rt -> events.remove(e.key); saveEvents(events); if (f) { - f(e.value.arg, e.value.time, rt); + f(e.key, e.value.arg, e.value.time, rt); } }) }; @@ -1330,10 +1330,9 @@ def beginPlan = { plan -> }; // Initial - basic checks and defaults namedEvents = [ - // name: func(arg, schedTime rt) - play: { arg, schedTime, rt -> playEvent(rt, arg) }, - redress: { arg, schedTime, rt -> redress(rt) }, - permit: { arg, schedTime, rt -> givePermission(arg) } + play: { name, arg, schedTime, rt -> playEvent(rt, arg) }, + redress: { name, arg, schedTime, rt -> redress(rt) }, + permit: { name, arg, schedTime, rt -> givePermission(arg) } ]; def setupInitial = { if (loadInteger("toy.version") == null) { |