Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Fix Issue #16 by ignoring irrelevant events for an automation topic.
Browse files Browse the repository at this point in the history
  • Loading branch information
SMerrony committed May 12, 2022
1 parent c82db0c commit a7746e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/aghastServer/aghastServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/SMerrony/aghast/server"
)

const SemVer = "v0.5.1" // TODO Update SemVer on each release
const SemVer = "v0.5.2" // TODO Update SemVer on each release

var (
configFlag = flag.String("configdir", "", "directory containing configuration files")
Expand Down
4 changes: 1 addition & 3 deletions integrations/automation/automation.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (a *Automation) testCondition(cond conditionT, eventPayload interface{}) bo
}
v, found := jsonMap[cond.Key]
if !found {
log.Printf("ERROR: Automation (Condition) - Could find Key in JSON %s\n", resp.Payload.(string))
// not an event we are interested in
return false
}

Expand Down Expand Up @@ -332,8 +332,6 @@ func (a *Automation) waitForMqttEvent(stopChan chan bool, auto automationT) {
}
log.Printf("DEBUG: Automation Manager sent Event to %s with payload %s\n", ac.Topic, ac.Payload)
}
} else {
log.Println("DEBUG: ... condition not met")
}
}
}
Expand Down

0 comments on commit a7746e4

Please sign in to comment.