From b76b9356083b816fcd09be6a3b1569d600f9c91f Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Fri, 6 Mar 2020 01:34:05 -0600 Subject: [PATCH] ther is no JSON response in fast mode --- lights.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lights.go b/lights.go index 4b4ee27..70cc85d 100644 --- a/lights.go +++ b/lights.go @@ -71,6 +71,10 @@ func (c *Client) SetState(selector string, state State) ([]Result, error) { defer resp.Body.Close() + if state.Fast && resp.StatusCode == http.StatusAccepted { + return nil, nil + } + if err = json.NewDecoder(resp.Body).Decode(&s); err != nil { log.Println(err) return nil, err