MyStrom: fix relay uri

This commit is contained in:
andig 2022-07-14 20:35:56 +02:00
parent c013dc53f8
commit ffd5eb03a7
2 changed files with 3 additions and 2 deletions

View file

@ -69,7 +69,7 @@ func (c *MyStrom) Enable(enable bool) error {
c.reportG = provider.Cached(c.Report, c.cache)
onoff := map[bool]int{false: 0, true: 1}
return c.Request(fmt.Sprintf("relay/state=%d", onoff[enable]))
return c.Request(fmt.Sprintf("relay?state=%d", onoff[enable]))
}
// MaxCurrent implements the api.Charger interface

View file

@ -2,6 +2,7 @@ package mystrom
import (
"fmt"
"strings"
"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/util"
@ -20,7 +21,7 @@ type Connection struct {
func NewConnection(uri string) *Connection {
return &Connection{
uri: uri,
uri: util.DefaultScheme(strings.TrimSuffix(uri, "/"), "http"),
Helper: request.NewHelper(util.NewLogger("mystrom")),
}
}