Json configuration (#141)

* Add json config
* Adjust code to new config

---------

Co-authored-by: Chris <git@nootch.de>
This commit is contained in:
Chris
2024-11-11 21:38:13 +01:00
committed by GitHub
parent fc74cde56f
commit ed3226e522
21 changed files with 726 additions and 171 deletions

View File

@@ -9,10 +9,29 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
## Installation
Good installation guide:
https://meintechblog.de/2024/09/05/andreas-schmitz-joerg-installiert-mein-energieoptimierungssystem/
<https://meintechblog.de/2024/09/05/andreas-schmitz-joerg-installiert-mein-energieoptimierungssystem/>
The project requires Python 3.10 or newer.
## Configuration
This project uses a `config.json` file to manage configuration settings.
### Default Configuration
A default configuration file `default.config.json` is provided. This file contains all the necessary configuration keys with their default values.
### Custom Configuration
Users can specify a custom configuration directory by setting the environment variable `EOS_DIR`.
- If the directory specified by `EOS_DIR` contains an existing `config.json` file, the application will use this configuration file.
- If the `config.json` file does not exist in the specified directory, the `default.config.json` file will be copied to the directory as `config.json`.
### Configuration Updates
If the configuration keys in the `config.json` file are missing or different from those in `default.config.json`, they will be automatically updated to match the default settings, ensuring that all required keys are present.
### Quick Start Guide
On Linux (Ubuntu/Debian):
@@ -27,8 +46,7 @@ On MacOS (requires [Homebrew](https://brew.sh)):
brew install make
```
Next, adjust `config.py`.
The server can then be started with `make run`. A full overview of the main shortcuts is given by `make help`.
The server can be started with `make run`. A full overview of the main shortcuts is given by `make help`.
### Detailed Instructions
@@ -65,7 +83,6 @@ source .venv/bin/activate
## Usage
Adjust `config.py`.
To use the system, run `flask_server.py`, which starts the server:
```bash