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

  1. Rename .jinja files to remove the .jinja extension (or use the render command)
  2. Fill in the template variables
  3. Implement the device class (see Base Class)
  4. Define schemas (see Schemas)

Next steps