From 53246cda4a2b21c428412c3ee1e55bfa364e9b22 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 17 Jul 2022 17:32:26 +0200 Subject: [PATCH] MyStrom: avoid decoding empty report body --- meter/mystrom/mystrom.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meter/mystrom/mystrom.go b/meter/mystrom/mystrom.go index 32db988a4..aa8d86d66 100644 --- a/meter/mystrom/mystrom.go +++ b/meter/mystrom/mystrom.go @@ -2,6 +2,7 @@ package mystrom import ( "fmt" + "net/http" "strings" "github.com/evcc-io/evcc/api" @@ -28,7 +29,11 @@ func NewConnection(uri string) *Connection { func (c *Connection) Request(path string) error { uri := fmt.Sprintf("%s/%s", c.uri, path) - return c.GetJSON(uri, nil) + req, err := request.New(http.MethodGet, uri, nil, nil) + if err == nil { + _, err = c.DoBody(req) + } + return err } func (c *Connection) Report() (Report, error) {