mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-07 11:15:14 -06:00
fix bug with entityListeners using .Duration
This commit is contained in:
@@ -206,6 +206,7 @@ func callEntityListeners(app *App, msgBytes []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if l.delay != 0 {
|
if l.delay != 0 {
|
||||||
|
l := l
|
||||||
l.delayTimer = time.AfterFunc(l.delay, func() {
|
l.delayTimer = time.AfterFunc(l.delay, func() {
|
||||||
go l.callback(app.service, app.state, entityData)
|
go l.callback(app.service, app.state, entityData)
|
||||||
l.lastRan = carbon.Now()
|
l.lastRan = carbon.Now()
|
||||||
|
|||||||
Reference in New Issue
Block a user