feat: add xlsx export wherever csv export exists (#31690)

This commit is contained in:
andig 2026-07-12 11:58:02 +02:00 • committed by GitHub
parent 3158ff16ef
commit 3ce6600143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 873 additions and 425 deletions

View file

@ -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",
})
}