The PLESTY SDK provides a scaffolding command that generates a complete device module skeleton. This ensures your module follows the correct structure from the start.
Running the scaffold
cd repos/hub/devices
uv run plesty init device my-device
Replace my-device with your device name (lowercase, hyphens). The command creates a new directory with all required files.
Generated structure
my-device/
├── pyproject.toml.jinja
├── README.md.jinja
├── CHANGELOG.md.jinja
├── REUSE.toml.jinja
├── LICENSE
├── LICENSES/
│ └── LGPL-3.0-or-later.txt
├── .gitignore
├── .env.example.jinja
├── docs/
│ ├── index.md.jinja
│ └── toc.yaml
├── plesty/
│ └── my_device/
│ ├── __init__.py.jinja
│ └── __main__.py.jinja
├── tests/
│ ├── __init__.py.jinja
│ └── test_my_device.py.jinja
└── extras/
└── device/
├── base_device.py
└── device.py
What each file does
| File | Purpose |
|---|---|
pyproject.toml.jinja |
Package metadata, dependencies, build configuration |
README.md.jinja |
Project description and usage instructions |
CHANGELOG.md.jinja |
Version history |
REUSE.toml.jinja |
REUSE compliance configuration |
LICENSE / LICENSES/ |
LGPL-3.0-or-later license files |
.gitignore |
Git ignore rules |
.env.example.jinja |
Environment variable template |
docs/index.md.jinja |
Documentation landing page |
docs/toc.yaml |
Documentation table of contents |
plesty/my_device/init.py.jinja |
Package init — exports the device class |
plesty/my_device/main.py.jinja |
CLI entry point |
tests/init.py.jinja |
Test package init |
tests/test_my_device.py.jinja |
Test skeleton |
extras/device/base_device.py |
Base device implementation reference |
extras/device/device.py |
Device implementation reference |
Template variables
The .jinja files contain template variables that get rendered with your device name. The scaffold command handles this automatically.
After scaffolding
- Rename
.jinjafiles to remove the.jinjaextension (or use the render command) - Fill in the template variables
- Implement the device class (see Base Class)
- Define schemas (see Schemas)
Next steps
- Learn about the base class and mandatory methods
- Define your device schemas