From e28b25f8efebf346b92725d291e90324e6c8c47c Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Wed, 14 May 2025 13:26:42 +0200 Subject: [PATCH] docs: template contribution (#21215) --- CONTRIBUTING.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index deb38462a..5c967ef8b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,16 +15,29 @@ make lint make lint-ui ``` -#### Changing device templates +#### Device templates -evcc supports a massive amount of different devices. To keep our documentation and website in sync with the latest software the core project (this repo) generates meta-data that's pushed to the `docs` and `evcc.io` repository. +The software supports a massive amount of different devices (charger, meter, vehicle, tariff) that are defined by **templates**. +A template can use the [plugin system](https://docs.evcc.io/docs/devices/plugins) (preferred) for communication with the device or reference a dedicated Go implementation. +All bundled templates are located in the [`/templates/definition`](https://github.com/evcc-io/evcc/tree/master/templates/definition) directory. -You can verify the generated meta-data by running: +If you want to add a new plugin we recommend looking at existing, similar implementations for reference. +When your template requires Go code you have to build the project from source (see instructions below). +Otherwise you can use the evcc binary and point it to your new template file for testing. + +```sh +evcc --template-type charger --template new-charger-template.yaml +``` + +Besides the actual device configuration, templates contain meta-data like product name, manufacturer, instructions how to configure the device to work with evcc. +On release, this data is extracted and pushed to the [`evcc-io/docs`](https://github.com/evcc-io/docs) repository to keep the documentation in sync. You can verify the generated meta-data by running: ```sh make docs ``` +This will write the documentation-relevant data to `/templates/docs`. + ### Building from source Install prerequisites (once):