Example

The example extension provides a set of interfaces to the core components for demonstration purposes. Example components don't connect to any real system but mimic functionality for testing.

This extension does not take an extension level configs and is focused on interfaces.


Sensor Interface

Provides a sensor that returns a random integer.

OptionTypeRequiredDescription
key[String]YesUnique slug id for the component
name[String]NoFriendly display name of component. Useful for UI.
data[Integer]NoReturns a number between 0 and data. Default 10

Config Examples

Here is a config of a complete example sensor.

"sensor": [{
    "key": "example_sensor_1",
    "interface": "example",
    "data": 10
}]

Control Interface

Provides a control that will randomly change its state based on update_chance.

OptionTypeRequiredDescription
key[String]YesUnique slug id for the component
name[String]NoFriendly display name of component. Useful for UI.
update_chance[Integer]NoPercent chance (0-100) it should change state. Default 25
type[String]NoType of control behavior. Options: button control or potentiometer. Default: button

Config

Here is a config of a complete example control.

"control": [{
    "key": "example_control_1",
    "interface": "example",
    "update_chance": 10,
    "type": "switch"
}]

Toggle Interface

Provides a toggle that is a boolean in memory you can toggle.

OptionTypeRequiredDescription
key[String]YesUnique slug id for the component
name[String]NoFriendly display name of component. Useful for UI.
max_duration[Integer]NoFailsafe duration (in seconds) to turn off toggle after. 0 means off. Default 0

Config

Here is a config of a complete example toggle.

"toggle": [{
    "key": "example_toggle_1",
    "interface": "example",
    "max_duration": 360
}]

Character Display Interface

Provides a character display that prints messages to the log.

OptionTypeRequiredDescription
key[String]YesUnique slug id for the component
name[String]NoFriendly display name of component. Useful for UI.
message_limit[Integer]NoMax number of messages to take in queue before overwriting. Default 20
max_duration[Integer]NoMax duration allowed to display a message in seconds. Default 60
default_duration[Integer]NoDefault duration fallback if one is not set for a new message. Default 5
topic[String]NoTopic display listens on for events. Default char_display/{key}

Config

Here is a config of a complete example character display.

"char_display": [{
    "key": "example_display_1",
    "interface": "example",
    "max_duration": 30,
    "default_duration": 10,
    "topic": "char_display/example_display_1"
}]