Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename default plugin and plugin type key #927

Merged
merged 9 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
andig committed May 5, 2021
commit cff44546f528fabb0518fe14738f30280b457592
2 changes: 1 addition & 1 deletion internal/charger/charger.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewConfigurableFromConfig(other map[string]interface{}) (api.Charger, error
"maxcurrent": cc.MaxCurrent.PluginType(),
} {
if v == "" {
return nil, fmt.Errorf("default charger config: missing plugin configuration: %s", k)
return nil, fmt.Errorf("missing plugin configuration: %s", k)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/charger/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewFromConfig(typ string, other map[string]interface{}) (v api.Charger, err
factory, err := registry.Get(strings.ToLower(typ))
if err == nil {
if v, err = factory(other); err != nil {
err = fmt.Errorf("cannot create type '%s': %w", typ, err)
err = fmt.Errorf("cannot create charger '%s': %w", typ, err)
}
} else {
err = fmt.Errorf("invalid charger type: %s", typ)
Expand Down
2 changes: 1 addition & 1 deletion internal/meter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewFromConfig(typ string, other map[string]interface{}) (v api.Meter, err e
factory, err := registry.Get(strings.ToLower(typ))
if err == nil {
if v, err = factory(other); err != nil {
err = fmt.Errorf("cannot create type '%s': %w", typ, err)
err = fmt.Errorf("cannot create meter '%s': %w", typ, err)
}
} else {
err = fmt.Errorf("invalid meter type: %s", typ)
Expand Down
2 changes: 1 addition & 1 deletion internal/meter/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewConfigurableFromConfig(other map[string]interface{}) (api.Meter, error)

for k, v := range map[string]string{"power": cc.Power.PluginType()} {
if v == "" {
return nil, fmt.Errorf("default meter config: missing plugin configuration: %s", k)
return nil, fmt.Errorf("missing plugin configuration: %s", k)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/vehicle/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewFromConfig(typ string, other map[string]interface{}) (v api.Vehicle, err
factory, err := registry.Get(strings.ToLower(typ))
if err == nil {
if v, err = factory(other); err != nil {
err = fmt.Errorf("cannot create type '%s': %w", typ, err)
err = fmt.Errorf("cannot create vehicle '%s': %w", typ, err)
}
} else {
err = fmt.Errorf("invalid vehicle type: %s", typ)
Expand Down
2 changes: 1 addition & 1 deletion internal/vehicle/vehicle.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewConfigurableFromConfig(other map[string]interface{}) (api.Vehicle, error

for k, v := range map[string]string{"charge": cc.Charge.PluginType()} {
if v == "" {
return nil, fmt.Errorf("default vehicle config: missing plugin configuration: %s", k)
return nil, fmt.Errorf("missing plugin configuration: %s", k)
}
}

Expand Down