summaryrefslogtreecommitdiff
path: root/shelly.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2026-03-25 20:33:22 +0100
committerxengineering <me@xengineering.eu>2026-03-25 21:09:11 +0100
commit476db7047a9c650057c034c647ea66f3c38e8a53 (patch)
tree72fd518f6549943ba62ec724b8b51421a537f0ca /shelly.go
parentbfd840bfd843f95183568f7ef6a9880a810ce049 (diff)
downloadsia-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 'shelly.go')
-rw-r--r--shelly.go4
1 files changed, 2 insertions, 2 deletions
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)