Functions

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.api_partition

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.check_arguments

Checks arguments from the mympd_arguments global variable.

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_header_get

Get a http header.

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.isnilorempty

Checks for empty string or nil.

mympd.jsonrpc_error

Creates a JSONRPC 2.0 error.

mympd.jsonrpc_notification

Creates a JSONRPC 2.0 notification.

mympd.jsonrpc_warn

Creates a JSONRPC 2.0 warning.

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.remove_file

Deletes a file or empty directory.

mympd.sleep

Sleep ms.

mympd.splitlines

mympd.tblvalue_in_list

Checks a Lua table of tags against a comma separated list

mympd.tmp_file

Generates a random tmp filename for the misc cache.

mympd.tmpvar_delete

Deletes a temporary variable.

mympd.tmpvar_get

Gets a temporary variable.

mympd.tmpvar_list

Lists all temporary variables.

mympd.tmpvar_set

Sets a temporary variable.

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.