MyStrom: avoid decoding empty report body
This commit is contained in:
parent
97c5b332d2
commit
53246cda4a
1 changed files with 6 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue