A simple test plugin for the LEDMatrix plugin system. Displays a customizable greeting message with optional time display.
This plugin serves as:
- Test plugin for validating the plugin system works correctly
- Example plugin for developers creating their own plugins
- Simple demonstration of the BasePlugin interface
- ✅ Customizable greeting message
- ✅ Optional time display
- ✅ Configurable text colors
- ✅ Proper error handling
- ✅ Configuration validation
This plugin is included as a test plugin. To enable it:
- Edit
config/config.jsonand add:
{
"hello-world": {
"enabled": true,
"message": "Hello, World!",
"show_time": true,
"color": [255, 255, 255],
"time_color": [0, 255, 255],
"display_duration": 10
}
}- Restart the display:
sudo systemctl restart ledmatrix| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable/disable the plugin |
message |
string | "Hello, World!" |
The greeting message to display |
show_time |
boolean | true |
Show current time below message |
color |
array | [255, 255, 255] |
RGB color for message (white) |
time_color |
array | [0, 255, 255] |
RGB color for time (cyan) |
display_duration |
number | 10 |
Display time in seconds |
{
"hello-world": {
"enabled": true
}
}{
"hello-world": {
"enabled": true,
"message": "Go Lightning!",
"color": [0, 128, 255],
"display_duration": 15
}
}{
"hello-world": {
"enabled": true,
"message": "LED Matrix",
"show_time": false,
"color": [255, 0, 255]
}
}After adding the configuration, check the logs:
sudo journalctl -u ledmatrix -f | grep hello-worldYou should see:
Discovered plugin: hello-world v1.0.0
Loaded plugin: hello-world
Hello World plugin initialized with message: 'Hello, World!'
Check if the plugin is installed:
curl http://localhost:5001/api/plugins/installed | jq '.plugins[] | select(.id=="hello-world")'The plugin will appear in the normal display rotation based on your display_duration setting.
This plugin demonstrates:
class HelloWorldPlugin(BasePlugin):
def __init__(self, plugin_id, config, display_manager, cache_manager, plugin_manager):
super().__init__(plugin_id, config, display_manager, cache_manager, plugin_manager)
# Initialize your plugin
def update(self):
# Fetch/update data
pass
def display(self, force_clear=False):
# Render to display
passdef validate_config(self):
# Validate configuration values
return Truetry:
# Plugin logic
except Exception as e:
self.logger.error(f"Error: {e}", exc_info=True)- Check that
manifest.jsonis valid JSON - Verify
enabled: truein config.json - Check logs for error messages
- Ensure Python path is correct
- Verify display_manager is initialized
- Check that colors are valid RGB arrays
- Ensure message isn't too long for display
- Validate JSON syntax in config.json
- Check that all color arrays have 3 values (RGB)
- Ensure display_duration is a positive number
GPL-3.0 License - Same as LEDMatrix project
This is a reference plugin included with LEDMatrix. Feel free to use it as a template for your own plugins!
For plugin system questions, see: