summaryrefslogtreecommitdiff
path: root/shelly.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2026-03-26 21:35:43 +0100
committerxengineering <me@xengineering.eu>2026-03-26 21:35:43 +0100
commit0fb9d297871e57372c469c6e8ca2b43813ed1f52 (patch)
treeffe261f4141c823bb6d345e6e22e12ec630b8ae5 /shelly.go
parenta965777d436f3bd68686e3b33066459c7ed5a01c (diff)
parent0ec5e0034891075ca0c70c6d29e20442c8ddb46e (diff)
downloadsia-server-0fb9d297871e57372c469c6e8ca2b43813ed1f52.tar
sia-server-0fb9d297871e57372c469c6e8ca2b43813ed1f52.tar.zst
sia-server-0fb9d297871e57372c469c6e8ca2b43813ed1f52.zip
Merge branch 'discovery'
This allows the client to discover the existence of Shelly and TP-Link devices.
Diffstat (limited to 'shelly.go')
-rw-r--r--shelly.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/shelly.go b/shelly.go
index 508b393..2fa2fa6 100644
--- a/shelly.go
+++ b/shelly.go
@@ -9,7 +9,11 @@ import (
"github.com/gorilla/websocket"
)
-func ShellyRun(config ShellyConfigs, route Route) {
+func ShellyRun(config ShellyConfigs, tx chan MQTTMessage, route Route) {
+ for _, shelly := range config {
+ tx <- MQTTMessage{fmt.Sprintf("cover/%s", shelly.ID), []byte("exists"), true}
+ }
+
for message := range route.Destination {
ip, command, err := parseMessage(config, message)
if err != nil {