SGready: fix panic
This commit is contained in:
parent
db1870021d
commit
d0a0dc52d1
1 changed files with 3 additions and 3 deletions
|
|
@ -73,14 +73,14 @@ func NewSgReadyFromConfig(ctx context.Context, other map[string]any) (api.Charge
|
|||
return nil, err
|
||||
}
|
||||
|
||||
modeS, err := cc.SetMode.IntSetter(ctx, "mode")
|
||||
modeSet, err := cc.SetMode.IntSetter(ctx, "mode")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log := util.ContextLoggerWithDefault(ctx, util.NewLogger("sgready"))
|
||||
|
||||
modeS = func(mode int64) error {
|
||||
modeS := func(mode int64) error {
|
||||
switch mode {
|
||||
case Dim:
|
||||
log.DEBUG.Printf("set sgready mode: %s", "dim")
|
||||
|
|
@ -89,7 +89,7 @@ func NewSgReadyFromConfig(ctx context.Context, other map[string]any) (api.Charge
|
|||
case Boost:
|
||||
log.DEBUG.Printf("set sgready mode: %s", "boost")
|
||||
}
|
||||
return modeS(mode)
|
||||
return modeSet(mode)
|
||||
}
|
||||
|
||||
modeG, err := cc.GetMode.IntGetter(ctx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue