summaryrefslogtreecommitdiff
path: root/tplink.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 /tplink.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 'tplink.go')
-rw-r--r--tplink.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/tplink.go b/tplink.go
index 11d8ab1..a256e71 100644
--- a/tplink.go
+++ b/tplink.go
@@ -16,7 +16,11 @@ const (
TPLink_HS100_OFF = false
)
-func TPLinkRun(config TPLinkConfigs, route Route) {
+func TPLinkRun(config TPLinkConfigs, tx chan MQTTMessage, route Route) {
+ for _, tplink := range config {
+ tx <- MQTTMessage{fmt.Sprintf("plug/%s", tplink.ID), []byte("exists"), true}
+ }
+
for message := range route.Destination {
ip, action, err := tplinkParseMessage(config, message)
if err != nil {