Easee: fix POST methods garbled during refactoring (#983)
This commit is contained in:
parent
3d7074cb23
commit
83cd864d6a
1 changed files with 3 additions and 3 deletions
|
|
@ -183,7 +183,7 @@ func (c *Easee) Enable(enable bool) error {
|
|||
|
||||
var req *http.Request
|
||||
uri := fmt.Sprintf("%s/chargers/%s/settings", easee.API, c.charger)
|
||||
if req, err = request.New(http.MethodGet, uri, request.MarshalJSON(data), request.JSONEncoding); err == nil {
|
||||
if req, err = request.New(http.MethodPost, uri, request.MarshalJSON(data), request.JSONEncoding); err == nil {
|
||||
_, err = c.Do(req)
|
||||
c.updated = time.Time{} // clear cache
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ func (c *Easee) Enable(enable bool) error {
|
|||
|
||||
var req *http.Request
|
||||
uri := fmt.Sprintf("%s/chargers/%s/commands/%s", easee.API, c.charger, action)
|
||||
if req, err = request.New(http.MethodGet, uri, nil, request.JSONEncoding); err == nil {
|
||||
if req, err = request.New(http.MethodPost, uri, nil, request.JSONEncoding); err == nil {
|
||||
_, err = c.Do(req)
|
||||
c.updated = time.Time{} // clear cache
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ func (c *Easee) MaxCurrentMillis(current float64) error {
|
|||
}
|
||||
|
||||
uri := fmt.Sprintf("%s/sites/%d/circuits/%d/settings", easee.API, c.site, c.circuit)
|
||||
req, err := request.New(http.MethodGet, uri, request.MarshalJSON(data), request.JSONEncoding)
|
||||
req, err := request.New(http.MethodPost, uri, request.MarshalJSON(data), request.JSONEncoding)
|
||||
if err == nil {
|
||||
_, err = c.Do(req)
|
||||
c.updated = time.Time{} // clear cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue