Compare commits

...

2 Commits

View File

@ -4,7 +4,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"net/http"
"strings" "strings"
) )
@ -201,7 +200,6 @@ func (c *Client) ValidateColor(color Color) (Color, error) {
var ( var (
err error err error
s *HSBKColor s *HSBKColor
r *http.Response
resp *Response resp *Response
) )
@ -209,13 +207,12 @@ func (c *Client) ValidateColor(color Color) (Color, error) {
return nil, err return nil, err
} }
resp, err = NewResponse(r)
if err != nil {
return nil, err
}
defer resp.Body.Close() defer resp.Body.Close()
if resp.IsError() {
return nil, resp.GetLifxError()
}
if err = json.NewDecoder(resp.Body).Decode(&s); err != nil { if err = json.NewDecoder(resp.Body).Decode(&s); err != nil {
return nil, err return nil, err
} }