Tariffs: add outdoor temperature type and OpenMeteo (#27780)
Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
parent
68db0b7727
commit
d68e5e5809
34 changed files with 449 additions and 135 deletions
|
|
@ -272,3 +272,6 @@ tariffs:
|
|||
type: template
|
||||
template: demo-co2-forecast
|
||||
base: 350
|
||||
temperature:
|
||||
type: template
|
||||
template: demo-temperature-forecast
|
||||
|
|
|
|||
14
cmd/refs.go
14
cmd/refs.go
|
|
@ -97,19 +97,7 @@ func collectTariffRefs() error {
|
|||
}
|
||||
|
||||
// Collect all non-empty refs
|
||||
if refs.Grid != "" {
|
||||
references.tariff = append(references.tariff, refs.Grid)
|
||||
}
|
||||
if refs.FeedIn != "" {
|
||||
references.tariff = append(references.tariff, refs.FeedIn)
|
||||
}
|
||||
if refs.Co2 != "" {
|
||||
references.tariff = append(references.tariff, refs.Co2)
|
||||
}
|
||||
if refs.Planner != "" {
|
||||
references.tariff = append(references.tariff, refs.Planner)
|
||||
}
|
||||
references.tariff = append(references.tariff, refs.Solar...)
|
||||
references.tariff = slices.AppendSeq(references.tariff, refs.Used())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1214,6 +1214,7 @@ func configureTariffs(conf *globalconfig.Tariffs, names ...string) (*tariff.Tari
|
|||
eg.Go(func() error { return configureTariff(conf.Co2, refs.Co2, &tariffs.Co2) })
|
||||
eg.Go(func() error { return configureTariff(conf.Planner, refs.Planner, &tariffs.Planner) })
|
||||
eg.Go(func() error { return configureSolarTariffs(conf.Solar, refs.Solar, &tariffs.Solar) })
|
||||
eg.Go(func() error { return configureTariff(conf.Temperature, refs.Temperature, &tariffs.Temperature) })
|
||||
if err := eg.Wait(); err != nil {
|
||||
return &tariffs, &ClassError{ClassTariff, err}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue