Optimizer: re-run on vehicle changes and include unmodeled loads (#32681)

This commit is contained in:
andig 2026-08-10 11:03:57 +02:00 • committed by GitHub
parent cc9bfc2556
commit a237f698d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 124 additions and 13 deletions

View file

@ -191,6 +191,14 @@ func getHandler[T any](get func() T) http.HandlerFunc {
}
}
// callHandler invokes an api function without result
func callHandler(fun func()) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
fun()
jsonWrite(w, nil)
}
}
// updateSmartCostLimit sets the smart cost limit globally
func updateSmartCostLimit(site site.API, setLimit func(loadpoint.API, *float64)) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {