From 8e95443548c4de4d0d3d39067766050a8fbf474b Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Sun, 22 Nov 2020 12:29:53 +0100 Subject: [PATCH] Enable '-1' for zone and group in topic regExp --- mqtt/mqtt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mqtt/mqtt.go b/mqtt/mqtt.go index a49466f..f4fe238 100644 --- a/mqtt/mqtt.go +++ b/mqtt/mqtt.go @@ -124,8 +124,8 @@ var subscriptionHandler = func(client MQTT.Client, msg MQTT.Message) { //------------------------------------------------------------------- // create ID from topic - regexpWithType := "\\/ATB\\/[A-Z]+\\/[0-9]+\\/[0-9]+\\/mo" - regexpDefault := "\\/ATB\\/[0-9]+\\/[0-9]+\\/[0-9]+\\/[0-9]+\\/mo" + regexpWithType := "ATB\\/[A-Z]+\\/[\\-]*[0-9]+\\/[\\-]*[0-9]+\\/mo" + regexpDefault := "ATB\\/[0-9]+\\/[\\-]*[0-9]+\\/[\\-]*[0-9]+\\/[0-9]+\\/mo" topicSlice := strings.Split(msg.Topic(), "/")