Optimizer: make grid charging strategy configurable (#30782)

This commit is contained in:
andig 2026-06-16 12:27:30 +02:00 • committed by GitHub
parent ebe4a3d6a3
commit 494f6cf9bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 555 additions and 50 deletions

View file

@ -143,6 +143,11 @@ func boolHandler(set func(bool) error, get func() bool) http.HandlerFunc {
return handler(strconv.ParseBool, set, get)
}
// stringHandler updates string-param api
func stringHandler(set func(string) error, get func() string) http.HandlerFunc {
return handler(func(s string) (string, error) { return s, nil }, set, get)
}
// durationHandler updates duration-param api
func durationHandler(set func(time.Duration) error, get func() time.Duration) http.HandlerFunc {
return handler(util.ParseDuration, set, get)