Difference between revisions of "NETIO Lua Reference"

From wiki.netio-products.com
Jump to navigation Jump to search
(Redirected page to NETIO Specific Reference manual)
(Tag: New redirect)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Outlet Management ==
+
#REDIRECT [[NETIO Specific Reference manual]]
<big><b> devices.system </b></big>
 
* function [[Function devices.system.SetOut()|.SetOut()]] - turns the outlet on or off
 
* function [[Function devices.system.ResetOut()|.ResetOut()]] - turns the outlet off and then resets its previous state
 
* string [[String devices.system.output1_state|.output1_state]] - outlet's state
 
* number [[Number devices.system.output1_consumption|.output1_consumption]] - outlet's consumption (in Watts)
 
* number [[Number devices.system.output1_cumulatedConsumption|.output1_cumulatedConsumption]] - outlet's consumed energy (in Watthours)
 
* function [[Function devices.system.resetCumulativeConsumption()|.resetCumulativeConsumption()]] - resets outlet's energy counter
 
* string [[String devices.system.output1_consumptionStart|.output1_consumptionStart]] - date and time since the last energy counter reset
 
 
 
== Socket System Management ==
 
<big><b> devices.system</b> </big>
 
* number [[number devices.system.averageLoad|.averageLoad]] - socket's CPU load
 
* function [[Function devices.system.Reboot()|.Reboot()]] - reboot socket's system
 
* number [[Number devices.system.sessionCount|.sessionCount]] - number of connected users
 
* number [[Number devices.system.freeSpace|.freeSpace]] - free disk space
 
* number [[Number devices.system.totalSpace|.totalSpace]] - total disk space
 
 
 
== Socket Communication ==
 
* function [[Function ping()|ping()]] - tests socket's network responsivity
 
* function [[Function mail()|mail()]] - sends e-mail
 
* function [[Function devices.system.CustomCGI()|devices.system.CustomCGI()]] - send HTTP request
 
* function [[Function cgiGet()|cgiGet()]] <sup><code>2.3.5</code></sup> - send HTTP request and receive response
 
* table [[Table event.args|event.args]] - HTTP GET /event variables table
 
 
 
== XML Processing <sup><code>2.3.6</code></sup> ==
 
<big><b>xml</b></big>
 
* function [[Function xml.escape()|.escape()]] - escapes XML string to fit xml node contents
 
* function [[Function xml.check()|.check()]] - tests if string is well-formed XML
 
* function [[Function xml.parse()|.parse()]] - parses XML string into [[Function xml.parse()#XmlElement|XmlElement]] object
 
 
 
== Standard Lua Functions ==
 
* function [https://www.lua.org/pil/8.3.html assert(), error()] issues an error
 
* function [https://www.lua.org/pil/7.3.html ipairs(), pairs(), next()] traverse tables
 
* function [https://www.lua.org/pil/2.4.html tonumber(), tostring()] data type conversion
 
* function [https://www.lua.org/pil/8.4.html pcall()] protected call function (handles error inside the function)
 
* function [https://www.lua.org/pil/5.2.html select()] selects from multiple return value
 
* function [https://www.lua.org/pil/2.html unpack] converts table into multiple values
 
* function [https://www.lua.org/pil/2.html type()] returns variable type
 
* function [https://www.lua.org/pil/22.1.html os.date(), os.time()] system date and time
 
 
 
== Miscellaneous ==
 
* function [[Function log()|log()]] - insert a record to the socket's event log
 
* function [[Function logf()|logf()]] - insert a formated record (incl. numbers) to the socket's event log
 
* function [[Function delay()|delay()]] - execute function with delay (seconds)
 
* function [[Function milliDelay()|milliDelay()]] - execute function with delay (milliseconds)
 
* function [[Function toboolean()|toboolean()]] - converts any variable to boolean type
 

Latest revision as of 17:51, 11 July 2019