diff --git a/main.go b/main.go index ac98c20..295ed2a 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ // Idea: Gather settings only on start-up. // TODO: Only update meter readings such as yieldday, yieldtotal on-change. // TODO: Add a health check endpoint, potentially log to it. +// TODO: Add support for monitoring multiple OpenDTU's at once. package main import ( @@ -563,7 +564,9 @@ func getPreviousEventsCount(db *sql.DB, inverterSerial string) int { } func insertEvents(db *sql.DB, inverterSerial string, events *EventsResponse) { - timestamp := time.Now() + timeZone := config.TZ + loc, _ := time.LoadLocation(timeZone) + timestamp := time.Now().In(loc) for _, event := range events.Events { // Insert events data into the events table