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.
Provides a sensor that returns a random integer.
Option | Type | Required | Description |
key | [String] | Yes | Unique slug id for the component |
name | [String] | No | Friendly display name of component. Useful for UI. |
data | [Integer] | No | Returns a number between 0 and data . Default 10 |
Here is a config of a complete example sensor.
"sensor": [{
"key": "example_sensor_1",
"interface": "example",
"data": 10
}]
Provides a control that will randomly change its state based on update_chance
.
Option | Type | Required | Description |
key | [String] | Yes | Unique slug id for the component |
name | [String] | No | Friendly display name of component. Useful for UI. |
update_chance | [Integer] | No | Percent chance (0-100) it should change state. Default 25 |
type | [String] | No | Type of control behavior. Options: button control or potentiometer . Default: button |
Here is a config of a complete example control.
"control": [{
"key": "example_control_1",
"interface": "example",
"update_chance": 10,
"type": "switch"
}]
Provides a toggle that is a boolean in memory you can toggle.
Option | Type | Required | Description |
key | [String] | Yes | Unique slug id for the component |
name | [String] | No | Friendly display name of component. Useful for UI. |
max_duration | [Integer] | No | Failsafe duration (in seconds) to turn off toggle after. 0 means off. Default 0 |
Here is a config of a complete example toggle.
"toggle": [{
"key": "example_toggle_1",
"interface": "example",
"max_duration": 360
}]
Provides a character display that prints messages to the log.
Option | Type | Required | Description |
key | [String] | Yes | Unique slug id for the component |
name | [String] | No | Friendly display name of component. Useful for UI. |
message_limit | [Integer] | No | Max number of messages to take in queue before overwriting. Default 20 |
max_duration | [Integer] | No | Max duration allowed to display a message in seconds. Default 60 |
default_duration | [Integer] | No | Default duration fallback if one is not set for a new message. Default 5 |
topic | [String] | No | Topic display listens on for events. Default char_display/{key} |
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"
}]