Re-add deprecated soc levels

This commit is contained in:
andig 2021-04-26 08:28:16 +02:00
parent e678daba4d
commit 7132d3005d

View file

@ -44,6 +44,7 @@ type SoCConfig struct {
Estimate bool `mapstructure:"estimate"`
Min int `mapstructure:"min"` // Default minimum SoC, guarded by mutex
Target int `mapstructure:"target"` // Default target SoC, guarded by mutex
Levels []int `mapstructure:"levels"` // deprecated
}
// Poll modes
@ -158,6 +159,10 @@ func NewLoadPointFromConfig(log *util.Logger, cp configProvider, other map[strin
}
}
if len(lp.SoC.Levels) > 0 {
log.WARN.Printf("soc.levels are deprecated and will be removed in an upcoming release")
}
if lp.SoC.Target == 0 {
lp.SoC.Target = lp.OnDisconnect.TargetSoC // use disconnect value as default soc
if lp.SoC.Target == 0 {