diff options
| author | xengineering <me@xengineering.eu> | 2026-03-25 20:33:22 +0100 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2026-03-25 21:09:11 +0100 |
| commit | 476db7047a9c650057c034c647ea66f3c38e8a53 (patch) | |
| tree | 72fd518f6549943ba62ec724b8b51421a537f0ca /main.go | |
| parent | bfd840bfd843f95183568f7ef6a9880a810ce049 (diff) | |
| download | sia-server-476db7047a9c650057c034c647ea66f3c38e8a53.tar sia-server-476db7047a9c650057c034c647ea66f3c38e8a53.tar.zst sia-server-476db7047a9c650057c034c647ea66f3c38e8a53.zip | |
Refactor and add routing concept
This scales better when additional receiving routes will be added.
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) } |
