Module lcdproc

A LCDproc client module.

Info:

  • Copyright: denpamusic 2020
  • License: MIT
  • Author: denpamusic

Class LCDproc

LCDproc.server LCDproc server info
LCDproc.display LCDproc display info
LCDproc.handlers event handlers table
LCDproc.new ([host[, port[, opts]]]) create client instance
LCDproc.every (interval, fn) Helper function to run the callback every interval
LCDproc:request (line) make request to LCDproc server
LCDproc:hello () initiate the LCDproc session
LCDproc:set_name (name) set client name
LCDproc:add_screen (id) add new screen
LCDproc:del_screen (id) remove screen
LCDproc:add_key (id, mode) add new key
LCDproc:del_key (id) remove key
LCDproc:add_menu () add main menu to the client
LCDproc:backlight (state) set display backlight state
LCDproc:output (state) set display gpio state
LCDproc:info () get display driver info
LCDproc:noop () do nothing
LCDproc:sleep (seconds) sleep for a given amount of seconds
LCDproc:poll () poll connection
LCDproc:do_events (line) handle server events
LCDproc:on_listen (fn) register screen listen event handler
LCDproc:on_ignore (fn) register screen ignore event handler
LCDproc:on_keypress (fn) register key press event handler
LCDproc:on_menu (fn) register menu event handler
LCDproc:close () close connection


Class LCDproc

A LCDproc client class.
LCDproc.server
LCDproc server info

Fields:

  • version LCDproc version
  • protocol protocol version
LCDproc.display
LCDproc display info

Fields:

  • width display width
  • height display height
  • cell_width display cell width
  • cell_height display cell height
LCDproc.handlers
event handlers table

Fields:

  • listen
LCDproc.new ([host[, port[, opts]]])
create client instance

Parameters:

  • host string LCDproc server host (localhost) (optional)
  • port int LCDproc server port (13666) (optional)
  • opts table additional options ({ timeout = 3, debug = false }) (optional)

Returns:

    LCDproc the new LCDproc client
LCDproc.every (interval, fn)
Helper function to run the callback every interval

Parameters:

  • interval string inteval string (i. e. “5m”) Supports “h” for hours, “m” for minutes and “s” for seconds
  • fn func callback function
LCDproc:request (line)
make request to LCDproc server

Parameters:

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:hello ()
initiate the LCDproc session

See also:

LCDproc:set_name (name)
set client name

Parameters:

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:add_screen (id)
add new screen

Parameters:

Returns:

    Screen the new screen
LCDproc:del_screen (id)
remove screen

Parameters:

LCDproc:add_key (id, mode)
add new key

Parameters:

LCDproc:del_key (id)
remove key

Parameters:

LCDproc:add_menu ()
add main menu to the client

Returns:

    Menu the main menu
LCDproc:backlight (state)
set display backlight state

Parameters:

  • state string backlight state (on | off | toggle | blink | flash)

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:output (state)
set display gpio state

Parameters:

  • state string (on | off | number)

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:info ()
get display driver info

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:noop ()
do nothing

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:sleep (seconds)
sleep for a given amount of seconds

Parameters:

  • seconds int number of seconds to sleep

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:poll ()
poll connection

Returns:

  1. string LCDproc server response
  2. string error description
LCDproc:do_events (line)
handle server events

Parameters:

Returns:

    string event type
LCDproc:on_listen (fn)
register screen listen event handler

Parameters:

  • fn func handler function
LCDproc:on_ignore (fn)
register screen ignore event handler

Parameters:

  • fn func handler function
LCDproc:on_keypress (fn)
register key press event handler

Parameters:

  • fn func handler function
LCDproc:on_menu (fn)
register menu event handler

Parameters:

  • fn func handler function
LCDproc:close ()
close connection
generated by LDoc 1.4.6 Last updated 2020-05-09 12:37:17