feature-scenesystem (#1)
continuous-integration/drone/push Build is passing

Co-authored-by: Gisle Aune <dev@gisle.me>
Reviewed-on: #1
Co-authored-by: gisle <gisle@hidden-email>
Co-committed-by: gisle <gisle@hidden-email>
This commit was merged in pull request #1.
This commit is contained in:
2021-10-06 18:13:16 +00:00
co-authored by gisle
parent d91bd472dd
commit ba22187e6e
38 changed files with 1898 additions and 225 deletions
+3
View File
@@ -122,6 +122,9 @@ func (state *hueSensorState) Update(newData SensorData) *models.Event {
if time.Since(stateTime) > time.Second*3 {
return nil
}
if state.prevData == nil {
return nil
}
pe := state.prevData.State.ButtonEvent
ce := newData.State.ButtonEvent
+3 -1
View File
@@ -204,7 +204,9 @@ func (b *Bridge) Run(ctx context.Context, debug bool) error {
b.checkAndUpdateState(state)
}
if time.Since(state.discoveredTime) > time.Second*10 {
if time.Since(state.discoveredTime) > time.Second*10 && time.Since(state.fwSpamTime) > time.Second * 30 {
state.fwSpamTime = time.Now()
if state.firmware == nil {
_, _ = client.Send(state.target, &GetHostFirmware{})
}
+1
View File
@@ -18,6 +18,7 @@ type State struct {
lightStateTime time.Time
requestTime time.Time
updateTime time.Time
fwSpamTime time.Time
acksPending []uint8
}
+1 -1
View File
@@ -177,7 +177,7 @@ func (b *bridge) Update(devices []models.Device) {
red, green, blue := color.RGB255()
newColor := [4]byte{red, green, blue, 255}
if newColor != panel.ColorRGBA {
panel.update(newColor, time.Now().Add(time.Millisecond*120))
panel.update(newColor, time.Now().Add(time.Millisecond*220))
}
} else {
panel.update([4]byte{0, 0, 0, 0}, time.Now())