Bugfix: Migrate insertLiveData and queryEventsEndpoint to new config struct.
This commit is contained in:
parent
d7262164f6
commit
6902facab6
1 changed files with 2 additions and 2 deletions
4
main.go
4
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)
|
||||
|
|
Loading…
Reference in a new issue