pulquero / BatteryAggregator

MIT License
36 stars 7 forks source link

Feature: Config Checker and Config Generator #61

Closed KaiGrassnick closed 5 months ago

KaiGrassnick commented 5 months ago

Hello everyone,

First of all, thank you @pulquero for this great project!

I encountered issues generating a correct and valid config.json, so I created a small Python script to help validate the config.json without having to restart the service constantly. The script uses jsonschema to validate the JSON. Since jsonschema is not included with Venus or this project by default, I added a helper script that asks if it should be installed automatically if not already present.

Usage instructions are described in the README.md.

Additionally, I considered Issue #57 and put together a simple config generator with some validation rules. While it’s not very complex or fancy, it works as intended. If anyone is interested, the generator could benefit from some refactoring.

Nonetheless, it is functional and, in my opinion, reasonably well-presented. I believe it will make it easier for people to use this excellent project!

I placed the config generator in the docs/config_generator folder so that it can be referenced for GitHub Pages. This way, the generator will be easily accessible as a web service. Note: The script is plain JavaScript without any libraries and does not store or send data anywhere.

You can test the config generator by downloading the index.html from docs/config_generator and open it in your browser. Alternativly it is currently also available from my fork: https://kaigrassnick.github.io/BatteryAggregator/config_generator/index.html

@pulquero if this PR finds it way into the Project and you want to host the config generator using the github pages you can do it as described below:

  1. Go to the settings page of this Project / Repository.
  2. Click on Pages
  3. Under Build and deployment there is a Headline called: Branch.
  4. There you can select the Branch main ( if it was merged into the main branch already )
  5. Also select the folder /docs beside the branch
  6. Save
  7. Now, the page will be available after a couple seconds at: https://pulquero.github.io/BatteryAggregator/config_generator/index.html

Last but not least, i fixed some typos in the README.md file

Resolves pulquero/BatteryAggregator#57

pulquero commented 5 months ago

Thank you so much for this!

endurance1968 commented 5 months ago

Works - if we no could add some tool tips maybe explaining the options online then it would be perfect for beginners. At least it works and created a valid file for me. thanks for picking this up!!