mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-05 23:15:07 -06:00
add comment
This commit is contained in:
3
app.go
3
app.go
@@ -192,11 +192,14 @@ func (a *App) Start() {
|
||||
// entity listeners runOnStartup
|
||||
for eid, etls := range a.entityListeners {
|
||||
for _, etl := range etls {
|
||||
// ensure each ETL only runs once, even if
|
||||
// it listens to multiple entities
|
||||
if etl.runOnStartup && !etl.runOnStartupCompleted {
|
||||
entityState, err := a.state.Get(eid)
|
||||
if err != nil {
|
||||
log.Default().Println("Failed to get entity state \"", eid, "\" during startup, skipping RunOnStartup")
|
||||
}
|
||||
|
||||
etl.runOnStartupCompleted = true
|
||||
go etl.callback(a.service, a.state, EntityData{
|
||||
TriggerEntityId: eid,
|
||||
|
||||
Reference in New Issue
Block a user