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:
parent
d264ec41c5
commit
914ac75167
38 changed files with 1920 additions and 857 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue