Im trying to figure out how to pass 'evt' data from an event handler to another a handler function after a delay.
This wont work: runIn(60, myHandler(evt)) because cant use parentheses in a runIn
This runIn(60, myHandler, [data:evt]) throws error java.lang.StackOverflowError: null (onTimeHandler)
With out a runIn delay calling this works fine as expected: myHandler(evt) Data is passed.
Is there another way to call a non-blocking delay then pass evt data to a function?
Something like this.. delay then myHandler(evt)
This works but I need more data the just the descriptionText. I want deviceId and value passed also. runIn(60, myHandler, [data:evt.descriptionText])
Is the full evt array to much data for a runIn data pass?
Ok, after messing around with a Map finally got it working.
evtMap = [value:evt.value, deviceId:evt.deviceId, descriptionText:evt.descriptionText]
if (pushDelay) { runIn(60, mytHandler, [data:evtMap]) }
On the other side in myHander(data) I can grab the mapped data. Example:
pushDevice.deviceNotification("App: ${app.label} -- $data.descriptionText")