Solcast: fix time shift (#20538)
This commit is contained in:
parent
46b549de7d
commit
e1b6e4e9bd
1 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ func (t *Solcast) run(interval time.Duration, done chan error) {
|
|||
var res solcast.Forecasts
|
||||
|
||||
if err := backoff.Retry(func() error {
|
||||
uri := fmt.Sprintf("https://api.solcast.com.au/rooftop_sites/%s/forecasts?period=PT60M&format=json", t.site)
|
||||
uri := fmt.Sprintf("https://api.solcast.com.au/rooftop_sites/%s/forecasts?period=PT30M&format=json", t.site)
|
||||
return backoffPermanentError(t.GetJSON(uri, &res))
|
||||
}, bo()); err != nil {
|
||||
once.Do(func() { done <- err })
|
||||
|
|
@ -91,7 +91,7 @@ func (t *Solcast) run(interval time.Duration, done chan error) {
|
|||
|
||||
NEXT:
|
||||
for _, r := range res.Forecasts {
|
||||
start := now.With(r.PeriodEnd.Add(-r.Period.Duration())).BeginningOfHour().Local()
|
||||
start := now.With(r.PeriodEnd).BeginningOfHour().Local()
|
||||
rr := api.Rate{
|
||||
Start: start,
|
||||
End: start.Add(time.Hour),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue