Functions

List of myMPD specific Lua functions.

FUNCTION DESCRIPTION
json.decode Parses a Json string to a Lua table.
json.encode Encodes a Lua table as Json string.
mympd.api Access to the myMPD API.
mympd.cache_cover_write Writes a cover cache file.
mympd.cache_lyrics_write Writes a lyrics cache file.
mympd.cache_thumbs_write Writes a thumbs cache file.
mympd.dialog Returns an Jsonrpc response for a script dialog.
mympd.gpio_blink Connects to myGPIOd and blinks a GPIO with given timeout and interval.
mympd.gpio_get Connects to myGPIOd and returns the active state of a GPIO.
mympd.gpio_set Connects to myGPIOd and sets the active value of a GPIO.
mympd.gpio_toggle Connects to myGPIOd and toggles the active value of a GPIO.
mympd.hash_md5 MD5 hash of string.
mympd.hash_sha1 SHA1 hash of string.
mympd.hash_sha256 SHA256 hash of string.
mympd.htmlencode Simple HTML encoding.
mympd.http_client Simple HTTP client.
mympd.http_download Download a file over http.
mympd.http_jsonrpc_error Sends a JSONRPC 2.0 error.
mympd.http_jsonrpc_response Sends a JSONRPC 2.0 response.
mympd.http_jsonrpc_warn Sends a JSONRPC 2.0 warning.
mympd.http_redirect Returns a valid HTTP redirect message.
mympd.http_reply Returns a valid HTTP response message.
mympd.http_serve_file Serves a file from the filesystem. Only files from the diskcache are allowed.
mympd.init Initializes the Lua table mympd_state.
mympd.log Logging to myMPD log.
mympd.notify_client Sends a notification to the client.
mympd.notify_partition Sends a notification to all clients in a partition.
mympd.os_capture Executes a system command and capture its output.
mympd.read_file Read an ascii file.
mympd.sleep Sleep ms.
mympd.splitlines Split string by newline characters and trims the lines.
mympd.tmp_file Generates a random tmp filename for the misc cache.
mympd.trim Removes beginning and ending whitespaces from a string.
mympd.update_mtime Updates the timestamp of a file.
mympd.urldecode Decodes a URL encoded string.
mympd.urlencode URL encodes a string.