Config UI: add user-defined devices (#20966)

Co-authored-by: andig <cpuidle@gmx.de>
Co-authored-by: andig <andi@evcc.io>
This commit is contained in:
Michael Geers 2025-05-25 23:08:35 +02:00 • committed by GitHub
parent d264ec41c5
commit 914ac75167
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 1920 additions and 857 deletions

View file

@ -2,6 +2,7 @@ package plugin
import (
"context"
"errors"
"fmt"
reg "github.com/evcc-io/evcc/util/registry"
@ -60,6 +61,10 @@ func plugin[T any](typ string, ctx context.Context, config *Config) (T, error) {
return zero, nil
}
if config.Source == "" {
return zero, errors.New("missing plugin source")
}
factory, err := registry.Get(config.Source)
if err != nil {
return zero, err