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. --- shelly.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'shelly.go') 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 { -- cgit v1.3