Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
15145d1f58 | |||
c6b538380c |
@ -237,7 +237,7 @@ func (c *Client) breathe(selector string, breathe Breathe) (*Response, error) {
|
|||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) setStates(selector string, states States) (*Response, error) {
|
func (c *Client) setStates(states States) (*Response, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
j []byte
|
j []byte
|
||||||
|
30
lights.go
30
lights.go
@ -40,19 +40,19 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Light struct {
|
Light struct {
|
||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
UUID string `json:"uuid"`
|
UUID string `json:"uuid"`
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
Connected bool `json:"connected"`
|
Connected bool `json:"connected"`
|
||||||
Power string `json:"power"`
|
Power string `json:"power"`
|
||||||
Color HSBKColor `json:"color"`
|
Color HSBKColor `json:"color"`
|
||||||
Brightness float64 `json:"brightness"`
|
Brightness float64 `json:"brightness"`
|
||||||
Effect string `json:"effect"`
|
Effect string `json:"effect"`
|
||||||
Group Selector `json:"group"`
|
Group Selector `json:"group"`
|
||||||
Location Selector `json:"location"`
|
Location Selector `json:"location"`
|
||||||
Product Product `json:"product"`
|
Product Product `json:"product"`
|
||||||
LastSeen time.Time `json:"last_seen"`
|
LastSeen *time.Time `json:"last_seen,omitempty"`
|
||||||
SecondsLastSeen float64 `json:"seconds_last_seen"`
|
SecondsLastSeen float64 `json:"seconds_last_seen"`
|
||||||
}
|
}
|
||||||
|
|
||||||
State struct {
|
State struct {
|
||||||
@ -156,14 +156,14 @@ func (c *Client) FastSetState(selector string, state State) (*LifxResponse, erro
|
|||||||
return c.SetState(selector, state)
|
return c.SetState(selector, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) SetStates(selector string, states States) (*LifxResponse, error) {
|
func (c *Client) SetStates(states States) (*LifxResponse, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
s *LifxResponse
|
s *LifxResponse
|
||||||
resp *Response
|
resp *Response
|
||||||
)
|
)
|
||||||
|
|
||||||
if resp, err = c.setStates(selector, states); err != nil {
|
if resp, err = c.setStates(states); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user