livebox:hah_plugboard_v2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
livebox:hah_plugboard_v2 [2014/01/03 02:33] – [Filter] brettlivebox:hah_plugboard_v2 [2014/09/01 08:33] – [Writing an Applet] brett
Line 258: Line 258:
  
 <code lua> <code lua>
 +require "xap"
 elapsed = 0 elapsed = 0
  
-function tick(self)+function tick(self, userdata)
   elapsed = elapsed + self.interval   elapsed = elapsed + self.interval
   print("Tick "..elapsed)   print("Tick "..elapsed)
   if elapsed > 10 then   if elapsed > 10 then
-    print(self.userdata)+    print(userdata)
     self:stop()     self:stop()
   end     end  
Line 270: Line 271:
  
 xap.Timer(tick, 2, "user data!"):start() xap.Timer(tick, 2, "user data!"):start()
 +xap.process()
 </code> </code>
  
Line 557: Line 559:
 The **init()** function will be invoked when the applet is loaded by the plugboard.lua script. The **init()** function will be invoked when the applet is loaded by the plugboard.lua script.
  
-To be automatically loaded they must be placed in the /etc/plugboard directory and have the suffix Applet.lua.  Example file names:+**To be automatically loaded they must be placed in the /etc/plugboard directory and have the suffix Applet.lua.**  Example file names:
   * hbeatWatchdogApplet.lua   * hbeatWatchdogApplet.lua
   * bindRelaysApplet.lua   * bindRelaysApplet.lua
  • livebox/hah_plugboard_v2.txt
  • Last modified: 2015/01/20 00:37
  • by brett