diff --git a/tariff/config.go b/tariff/config.go index 57aae51eb..650573531 100644 --- a/tariff/config.go +++ b/tariff/config.go @@ -28,5 +28,10 @@ func NewFromConfig(ctx context.Context, typ string, other map[string]interface{} return nil, fmt.Errorf("cannot create tariff type '%s': %w", typ, err) } + // check slot length + if rr, err := v.Rates(); err == nil && len(rr) > 0 && rr[0].End.Sub(rr[0].Start) == SlotDuration { + return v, nil + } + return &SlotWrapper{Tariff: v}, nil }