refactor variable system to be the responsibility of effect enforcer.

This commit is contained in:
2023-01-15 22:56:37 +01:00
parent 4ec8918308
commit d2b2244e2f
11 changed files with 126 additions and 219 deletions
+1 -1
View File
@@ -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()})
}
}