Files
LEDMatrix/.cursor/plugin_templates
Chuck 93e2d29af6 docs: fix .cursor/ helper docs
The .cursor/ directory holds the dev-side helper docs that Cursor and
contributors using AI tooling rely on to bootstrap plugin development.
Several of them had the same bug patterns as the user-facing docs.

.cursor/plugin_templates/QUICK_START.md
- "Adding Image Rendering" section showed
  display_manager.draw_image(image, x=0, y=0). That method doesn't
  exist on DisplayManager (same bug as PLUGIN_API_REFERENCE.md and
  PLUGIN_DEVELOPMENT_GUIDE.md). Replaced with the canonical
  display_manager.image.paste((x,y)) pattern, including the
  transparency-mask form.

.cursor/plugins_guide.md
- 10 occurrences of ./dev_plugin_setup.sh — the script lives at
  scripts/dev/dev_plugin_setup.sh, so anyone copy-pasting these
  examples gets "command not found". Bulk fixed via sed.
- "Test with emulator: python run.py --emulator" — there's no
  --emulator flag. Replaced with the real options:
  EMULATOR=true python3 run.py for the full display, or
  scripts/dev_server.py for the dev preview.
- Secrets management section showed a fictional
  "config_secrets": { "api_key": "my-plugin.api_key" } reference
  field. Verified in src/config_manager.py:162-172 that secrets are
  loaded by deep-merging config_secrets.json into the main config.
  There is no separate reference field — just put the secret under
  the same plugin namespace and read it from the merged config.
  Rewrote the section with the real pattern.
- "ssh pi@raspberrypi" -> "ssh ledpi@your-pi-ip" (consistent with
  the rest of LEDMatrix docs which use ledpi as the default user)

.cursor/README.md
- Same ./dev_plugin_setup.sh -> ./scripts/dev/dev_plugin_setup.sh
  fix (×6 occurrences via replace_all).
- Same "python run.py --emulator" -> "EMULATOR=true python3 run.py"
  fix. Also added a pointer to scripts/dev_server.py for previewing
  plugins without running the full display.
- "Example Plugins: plugins/hockey-scoreboard/" — the canonical
  source is the ledmatrix-plugins repo. Installed copies land in
  plugin-repos/ or plugins/. Updated the line to point at the
  ledmatrix-plugins repo and explain both local locations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:08:46 -04:00
..
2025-12-27 14:15:49 -05:00
2025-12-27 14:15:49 -05:00
2025-12-27 14:15:49 -05:00
2026-04-07 10:08:46 -04:00
2025-12-27 14:15:49 -05:00
2025-12-27 14:15:49 -05:00
2025-12-27 14:15:49 -05:00

# Plugin Name

Brief description of what this plugin does.

## Features

- Feature 1
- Feature 2
- Feature 3

## Installation

1. Link the plugin to your LEDMatrix installation:

```bash
cd /path/to/LEDMatrix
./scripts/dev/dev_plugin_setup.sh link-github PLUGIN_ID
```

Or for local development:

```bash
./scripts/dev/dev_plugin_setup.sh link PLUGIN_ID /path/to/plugin/repo
```

2. Install dependencies:

```bash
pip install -r plugins/PLUGIN_ID/requirements.txt
```

3. Configure the plugin in `config/config.json`:

```json
{
  "PLUGIN_ID": {
    "enabled": true,
    "display_duration": 15
  }
}
```

**Note:** API keys and other sensitive credentials must be stored in `config/config_secrets.json`, not in `config/config.json`.

4. Store API keys in `config/config_secrets.json`:

```json
{
  "PLUGIN_ID": {
    "api_key": "your-secret-api-key"
  }
}
```

## Configuration

### Required Settings

- `enabled` (boolean): Enable or disable the plugin
- `api_key` (string): API key for external service (if required)

### Optional Settings

- `display_duration` (number): How long to display this plugin (default: 15 seconds)
- `refresh_interval` (integer): How often to refresh data in seconds (default: 60)
- `live_priority` (boolean): Enable live priority takeover (default: false)

## Display Modes

This plugin provides the following display modes:

- `PLUGIN_ID`: Main display mode

## API Requirements

This plugin requires:

- **API Name**: Description of API requirements
  - URL: https://api.example.com
  - Rate Limit: X requests per minute
  - Authentication: API key required

## Development

### Running Tests

```bash
cd plugins/PLUGIN_ID
python test_PLUGIN_ID.py
```

### Testing with Emulator

```bash
cd /path/to/LEDMatrix
python run.py --emulator
```

### Debugging

Enable debug logging in `config/config.json`:

```json
{
  "logging": {
    "level": "DEBUG"
  }
}
```

Check logs:

```bash
# On Raspberry Pi (if running as service)
journalctl -u ledmatrix -f

# Direct execution
python run.py
```

## Troubleshooting

### Plugin Not Loading

1. Check that `manifest.json` exists and is valid
2. Verify `entry_point` file exists
3. Check that `class_name` matches the class in manager.py
4. Review logs for import errors

### Configuration Errors

1. Validate config against `config_schema.json`
2. Check required fields are present
3. Verify data types match schema

### API Errors

1. Verify API key is correct
2. Check API rate limits
3. Review network connectivity
4. Check API service status

## License

[License information]

## Author

Your Name

## Links

- GitHub: https://github.com/username/ledmatrix-PLUGIN_ID
- Documentation: [Link to docs]
- Issues: https://github.com/username/ledmatrix-PLUGIN_ID/issues