Skip to content

Commit

Permalink
config: add example json config
Browse files Browse the repository at this point in the history
  • Loading branch information
DAMEK86 committed Jul 11, 2023
1 parent d95ec09 commit ef707b6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

config/local.toml
config/local.json
config/local.*
28 changes: 28 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"polling_interval_sec" : 5,
"inverters": [
{
"inverter": {
"username" : "user",
"password" : "",
"url" : "http://your-inverter-ip"
},
"influx_id" : "pvwr"
},
{
"inverter": {
"username" : "user2",
"password" : "",
"url" : "http://your-inverter-ip"
},
"influx_id" : "pvwr2"
}
],
"influx" : {
"url" : "http://your-influxdb.com",
"port" : 8086,
"db" : "influx-db",
"user" : "root",
"password" : ""
}
}
2 changes: 1 addition & 1 deletion src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::plenticore::InverterCfg;
use config::{Config, ConfigError, Environment, File};
use serde::Deserialize;

const DEFAULT_CONFIG_FILE_PATH: &str = "config/default.toml";
const DEFAULT_CONFIG_FILE_PATH: &str = "config/default.json";
const CONFIG_FILE_PREFIX: &str = "config/";

#[derive(Debug, Deserialize)]
Expand Down

0 comments on commit ef707b6

Please sign in to comment.