From 70bdaa99ebb7a7caf0c0c0c8ddd064a30eb25079 Mon Sep 17 00:00:00 2001 From: Hendrik van Wyk Date: Sat, 28 Feb 2015 15:16:29 +0200 Subject: [PATCH] Added command line argument to set the capacity of the batteries used. --- cmd/invertergui/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/invertergui/main.go b/cmd/invertergui/main.go index 25a9f8c..e7dda8c 100644 --- a/cmd/invertergui/main.go +++ b/cmd/invertergui/main.go @@ -41,11 +41,12 @@ import ( func main() { url := flag.String("url", "http://localhost:9005", "The url of the multiplus JSON interface.") + capacity := flag.Float64("capacity", 100, "The capacity of the batteries in the system.") flag.Parse() source := datasource.NewJSONSource(*url) poller := datasource.NewDataPoller(source, 10*time.Second) - gui := webgui.NewWebGui(poller, 100) + gui := webgui.NewWebGui(poller, *capacity) http.Handle("/", gui) http.Handle("/munin", http.HandlerFunc(gui.ServeMuninHTTP)) http.Handle("/muninconfig", http.HandlerFunc(gui.ServeMuninConfigHTTP))