Page 1 of 1

triggerInfo.trigger unavailable?

Posted: Friday 27 October 2017 9:30
by emme
Ciao,

on beta 8648 I'm having some issue using the triggerInfo table:

here is the code:

Code: Select all

return {
	on = { devices = { 'v*CTRL', 'TCM_vBagnetto' } },
	execute = function(dz, devVol, trgInfo)
	    
	    local dbg = dz.LOG_FORCE
	    for k, v in pairs(trgInfo) do
	        dz.log('VOLUMIO: '..k..', '..v..' '..trgInfo.trigger, dz.LOG_FORCE)
	    end 
    
    end
}
and got this as a result:
2017-10-27 09:07:58.049 Error: dzVents: Error: ...ticz/scripts/dzVents/generated_scripts/dzVolumioCTRL.lua:7: attempt to concatenate field 'trigger' (a nil value)
...why trigger is no longer available?

Re: triggerInfo.trigger unavailable?

Posted: Friday 27 October 2017 11:01
by Doler
Just my guess: trigger holds information on timer events and since your example triggers only on devices it will return nil.

Mark

Re: triggerInfo.trigger unavailable?

Posted: Friday 27 October 2017 11:05
by emme
uuuh... :cry: :cry: :cry: :roll:
triggerInfo.trigger: which timer rule triggered the script in case the script was called due to a timer event
my fault!!! (I've red it more than one, but I would red what I wanted to read :(


...it would be nice to have the triger info extended to all rules...

Re: triggerInfo.trigger unavailable?

Posted: Friday 27 October 2017 15:08
by dannybloe
That would be nice but that is very hard to do. At least that is what I remember ;-)