feat: add xlsx export wherever csv export exists (#31690)
This commit is contained in:
parent
3158ff16ef
commit
3ce6600143
29 changed files with 873 additions and 425 deletions
|
|
@ -1,11 +1,9 @@
|
|||
package smartgrid
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
csvutil "github.com/evcc-io/evcc/util/csv"
|
||||
"github.com/evcc-io/evcc/util/export"
|
||||
)
|
||||
|
||||
type GridSession struct {
|
||||
|
|
@ -26,9 +24,11 @@ const (
|
|||
|
||||
type GridSessions []GridSession
|
||||
|
||||
// WriteCsv implements the api.CsvWriter interface
|
||||
func (t *GridSessions) WriteCsv(ctx context.Context, w io.Writer) error {
|
||||
return csvutil.WriteStructSlice(ctx, w, t, csvutil.Config{
|
||||
var _ export.Writer = (*GridSessions)(nil)
|
||||
|
||||
// Write implements the export.Writer interface
|
||||
func (t *GridSessions) Write(ww export.RowWriter) error {
|
||||
return export.WriteStructSlice(ww, t, export.Config{
|
||||
I18nPrefix: "config.hems.csv",
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue