From 1dcfb8a6244eb11b7d27c3672cd4cc05d17f8d9a Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sat, 20 Mar 2021 21:24:44 -0500 Subject: [PATCH] Add Breathe struct constructor --- lights.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lights.go b/lights.go index 15fb507..3270b36 100644 --- a/lights.go +++ b/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) { var ( err error