Bugfix: Migrate insertLiveData and queryEventsEndpoint to new config struct.
All checks were successful
Build Docker image / build (push) Successful in 1m14s
Build Golang packages / release (push) Successful in 1m56s

This commit is contained in:
Pieter Hollander 2024-07-26 11:00:41 +02:00
parent d7262164f6
commit 6902facab6
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

View file

@ -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)