From 6902facab609bd674ddd6e498014f358ff10c11d Mon Sep 17 00:00:00 2001 From: Pieter Hollander Date: Fri, 26 Jul 2024 11:00:41 +0200 Subject: [PATCH] Bugfix: Migrate insertLiveData and queryEventsEndpoint to new config struct. --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9479234..4ea5cc7 100644 --- a/main.go +++ b/main.go @@ -425,7 +425,7 @@ func createTables(db *sql.DB) { } func insertLiveData(db *sql.DB, inverter Inverter, total Total, hints Hints) { - timeZone := os.Getenv("TZ") + timeZone := config.TZ loc, _ := time.LoadLocation(timeZone) timestamp := time.Now().In(loc) @@ -503,7 +503,7 @@ func insertLiveData(db *sql.DB, inverter Inverter, total Total, hints Hints) { } func queryEventsEndpoint(inverterSerial string) (*EventsResponse, error) { - remoteURL := os.Getenv("REMOTE_URL") + remoteURL := config.OpenDTU endpoint := fmt.Sprintf("http://"+remoteURL+"/api/eventlog/status?inv=%s", inverterSerial) resp, err := http.Get(endpoint)