yaq/traits/is-daemon


Core trait common to all yaq daemons.

configuration

Daemons with the is-daemon trait expect the following configuration:

port (integer)
TCP port for daemon to occupy.

serial (string) default: NULL
Serial number for the particular device represented by the daemon

make (String) default: NULL

model (String) default: NULL

methods

Daemons with the is-daemon trait expose the following public methods:

busy ➜ boolean
Returns true if daemon is currently busy.

id ➜ dictionary
JSON object with information to identify the daemon, including name, kind, make, model, serial.

get_config_filepath ➜ string
String representing the absolute filepath of the configuration file on the host machine.

get_config ➜ dictionary
Full configuration for the individual daemon as defined in the TOML file. This includes defaults and shared settings not directly specified in the daemon-specific TOML table.

get_traits ➜ [string]
Get a full list of the daemon traits.

get_state ➜ dictionary
Get daemon state, as saved in the state.toml file.

set_state
Set daemon state. Accepts any subset of the state dictionary, dynamically.

list_methods ➜ [string]
Get an array of all known public method names.

shutdown
Cleanly shutdown daemon.

help ➜ string
If method not given, return a human-readable string with information about the daemon as a whole. If method is given, return a human-readable string with the signature of the method on the first line and a description of the method on subsequent lines. The signature is not specified to be in any particular language. It is intended for usage by humans ONLY.
Arguments:

method, {'type': 'string'}

daemons

The following daemons implement the is-daemon trait:

adafruit-stepper-motor-hat
ads1115
continuous-hardware
gdrive
hardware
mcp3428
mcp9600
micro-hr
ne1000
system-monitor
wright-wl-motor