add ListLights function

This commit is contained in:
2020-03-06 23:00:21 -06:00
parent 40a7a9d741
commit e39d81f6cc
3 changed files with 78 additions and 0 deletions

View File

@ -167,3 +167,21 @@ func (c *Client) validateColor(color Color) (*http.Response, error) {
return resp, nil
}
func (c *Client) listLights(selector string) (*http.Response, error) {
var (
err error
req *http.Request
resp *http.Response
)
if req, err = c.NewRequest("GET", EndpointListLights(selector), nil); err != nil {
return nil, err
}
if resp, err = c.Client.Do(req); err != nil {
return nil, err
}
return resp, nil
}