From 0ec5e0034891075ca0c70c6d29e20442c8ddb46e Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 26 Mar 2026 21:02:20 +0100 Subject: Add Shelly / TP-Link device discovery This announces Shelly and TP-Link devices with an empty MQTT message. This makes it possible that a client can display the available devices. --- tplink.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tplink.go') 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 { -- cgit v1.3