summaryrefslogtreecommitdiff
path: root/tplink.go
diff options
context:
space:
mode:
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 {