Module netio
lua-netio is a library to control outputs of NETIO 4x smart power sockets from NETIO products a.s.
Functions
new (opts) | Create new instance. |
Functions
- new (opts)
-
Create new instance.
It invokes the new() function of the submodule, specified via opts.api
Parameters:
- opts options table with arguments
- url string URL or IP of the Netio socket you want to speak with
- port int Additional port (can also be written directly into the URL) (optional)
- user string Name of the user, who has the right to read and/or write to the API (optional)
- pass string The password of the user (optional)
- api string specify which API should be used (json or url) (default 'url')
Returns:
-
object
Instance table
Usage:
local Netio = require('netio') local socket_url_api = Netio.new({ url = 'http://netio.de', pass = 'demo' }) local socket_json_api = Netio.new({ url = 'http://netio.de', user = 'demo', pass = 'demo', api = 'json' })
- opts options table with arguments