Difference between revisions of "NETIO Lua Reference"
Jump to navigation
Jump to search
XML Processing
(→Standard Lua Functions) |
m (Jturon přesunul stránku Netio Lua Reference na NETIO Lua Reference) |
(No difference)
|
Revision as of 19:24, 5 May 2017
Contents
Outlet Management
devices.system
- function .SetOut() - turns the outlet on or off
- function .ResetOut() - turns the outlet off and then resets its previous state
- string .output1_state - outlet's state
- number .output1_consumption - outlet's consumption (in Watts)
- number .output1_cumulatedConsumption - outlet's consumed energy (in Watthours)
- function .resetCumulativeConsumption() - resets outlet's energy counter
- string .output1_consumptionStart - date and time since the last energy counter reset
Socket System Management
devices.system
- number .averageLoad - socket's CPU load
- function .Reboot() - reboot socket's system
- number .sessionCount - number of connected users
- number .freeSpace - free disk space
- number .totalSpace - total disk space
Socket Communication
- function ping() - tests socket's network responsivity
- function mail() - sends e-mail
- function devices.system.CustomCGI() - send HTTP request
- function cgiGet()
2.3.5
- send HTTP request and receive response - table event.args - HTTP GET /event variables table
XML Processing 2.3.6
xml
- function .escape() - escapes XML string to fit xml node contents
- function .check() - tests if string is well-formed XML
- function .parse() - parses XML string into XmlElement object
Standard Lua Functions
- function assert(), error() issues an error
- function ipairs(), pairs(), next() traverse tables
- function tonumber(), tostring() data type conversion
- function pcall() protected call function (handles error inside the function)
- function select() selects from multiple return value
- function unpack converts table into multiple values
- function type() returns variable type
- function os.date(), os.time() system date and time
- function os.difftime() returns time span between two times
Miscellaneous
- function log() - insert a record to the socket's event log
- function logf() - insert a formated record (incl. numbers) to the socket's event log
- function delay() - execute function with delay (seconds)
- function milliDelay() - execute function with delay (milliseconds)
- function toboolean() - converts any variable to boolean type