Skip to content

Commit

Permalink
Reduce initialization period to three seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwichmann committed Apr 22, 2019
1 parent f8ae606 commit 288b07f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion light.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
hue "github.com/stefanwichmann/go.hue"
)

const initializationDuration = 5 * time.Second
const initializationDuration = 3 * time.Second

// Light represents a light kelvin can automate in your system.
type Light struct {
Expand Down Expand Up @@ -139,6 +139,7 @@ func (light *Light) update(transistionTime time.Duration) (bool, error) {

// Keep adjusting the light state for 10 seconds after the light appeared
if light.Initializing {
log.Debugf("💡 Light %s - Light in initialization for %v (TargetColorTemperature: %d, CurrentColorTemperature: %d, TargetColor: %v, CurrentColor: %v, TargetBrightness: %d, CurrentBrightness: %d)", light.Name, time.Since(light.Appearance), light.HueLight.TargetColorTemperature, light.HueLight.CurrentColorTemperature, light.HueLight.TargetColor, light.HueLight.CurrentColor, light.HueLight.TargetBrightness, light.HueLight.CurrentBrightness)
hasChanged := light.HueLight.hasChanged()

// Disable initialization phase if 10 seconds have passed and the light state has been adopted
Expand Down

0 comments on commit 288b07f

Please sign in to comment.