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. --- shelly.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shelly.go') diff --git a/shelly.go b/shelly.go index 7396bbb..5f6f2ad 100644 --- a/shelly.go +++ b/shelly.go @@ -7,8 +7,8 @@ import ( "strings" ) -func ShellyRun(config ShellyConfigs, rx chan MQTTMessage) { - for message := range rx { +func ShellyRun(config ShellyConfigs, route Route) { + for message := range route.Destination { ip, command, err := parseMessage(config, message) if err != nil { log.Println(err) -- cgit v1.3