Compare commits
2 Commits
1e97025bca
...
1dcfb8a624
Author | SHA1 | Date | |
---|---|---|---|
1dcfb8a624 | |||
52f610489f |
@ -33,6 +33,6 @@ var (
|
|||||||
return BuildURL(Endpoint, fmt.Sprintf("/lights/%s/toggle", selector))
|
return BuildURL(Endpoint, fmt.Sprintf("/lights/%s/toggle", selector))
|
||||||
}
|
}
|
||||||
EndpointBreathe = func(selector string) string {
|
EndpointBreathe = func(selector string) string {
|
||||||
return BuildURL(Endpoint, fmt.Sprintf("/lights/%s/effect/breathe", selector))
|
return BuildURL(Endpoint, fmt.Sprintf("/lights/%s/effects/breathe", selector))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
18
lights.go
18
lights.go
@ -98,6 +98,24 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
DefaultBreatheCycles float64 = 1
|
||||||
|
DefaultBreathePeriod float64 = 1
|
||||||
|
DefaultBreathePersist bool = false
|
||||||
|
DefaultBreathePowerOn bool = true
|
||||||
|
DefaultBreathePeak float64 = 0.5
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewBreathe() Breathe {
|
||||||
|
var b Breathe
|
||||||
|
b.Period = DefaultBreathePeriod
|
||||||
|
b.Cycles = DefaultBreatheCycles
|
||||||
|
b.Persist = DefaultBreathePersist
|
||||||
|
b.PowerOn = DefaultBreathePowerOn
|
||||||
|
b.Peak = DefaultBreathePeak
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Client) SetState(selector string, state State) (*LifxResponse, error) {
|
func (c *Client) SetState(selector string, state State) (*LifxResponse, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
|
Loading…
Reference in New Issue
Block a user