From 476db7047a9c650057c034c647ea66f3c38e8a53 Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 25 Mar 2026 20:33:22 +0100 Subject: Refactor and add routing concept This scales better when additional receiving routes will be added. --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index e123c83..1678eac 100644 --- a/main.go +++ b/main.go @@ -18,12 +18,12 @@ func main() { config := GetStartupConfig(flags.ConfigPath) - rx := make(chan MQTTMessage) tx := make(chan MQTTMessage) + coverMovement := NewRoute("cover/+/movement", QoS2) - go MQTTRun(config.MQTT, rx, tx) + go MQTTRun(config.MQTT, tx, coverMovement) go HomematicRun(config.Homematic, tx) - go ShellyRun(config.Shelly, rx) + go ShellyRun(config.Shelly, coverMovement) Await(syscall.SIGTERM, syscall.SIGINT) } -- cgit v1.3