From a7746e424993973733a5af3d739bfcad003c72ef Mon Sep 17 00:00:00 2001 From: SMerrony Date: Thu, 12 May 2022 07:32:04 +0200 Subject: [PATCH] Fix Issue #16 by ignoring irrelevant events for an automation topic. --- cmd/aghastServer/aghastServer.go | 2 +- integrations/automation/automation.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/aghastServer/aghastServer.go b/cmd/aghastServer/aghastServer.go index f3eab46..ce8365b 100644 --- a/cmd/aghastServer/aghastServer.go +++ b/cmd/aghastServer/aghastServer.go @@ -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") diff --git a/integrations/automation/automation.go b/integrations/automation/automation.go index c2e20bf..280ebaa 100644 --- a/integrations/automation/automation.go +++ b/integrations/automation/automation.go @@ -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 } @@ -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") } } }