refactor variable system to be the responsibility of effect enforcer.
This commit is contained in:
@@ -388,7 +388,7 @@ func (b *Bridge) Run(ctx context.Context, bus *lucifer3.EventBus) interface{} {
|
||||
for id, value := range lastMotion {
|
||||
since := time.Since(value)
|
||||
sinceMod := since % (time.Second * 30)
|
||||
if sinceMod >= time.Second*27 || sinceMod <= time.Second*3 {
|
||||
if (since > time.Second*20) && (sinceMod >= time.Second*27 || sinceMod <= time.Second*3) {
|
||||
bus.RunEvent(events.MotionSensed{ID: id, SecondsSince: since.Seconds()})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user