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:
@@ -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{})
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ type State struct {
|
||||
lightStateTime time.Time
|
||||
requestTime time.Time
|
||||
updateTime time.Time
|
||||
fwSpamTime time.Time
|
||||
acksPending []uint8
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user