From 1987448d8b451fc05423ea0094aacd193122a376 Mon Sep 17 00:00:00 2001 From: jkerdreux-imt <jerome.kerdreux@imt-atlantique.fr> Date: Thu, 21 Nov 2024 14:19:17 +0100 Subject: [PATCH] Nothing --- gateway.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gateway.go b/gateway.go index 82ca332..1ca39ae 100644 --- a/gateway.go +++ b/gateway.go @@ -61,20 +61,19 @@ func (gw *Gateway) GetZDeviceByTopic(topic string) *Z2MDevice { // If the topic is /bridge/devices it will parse the json and create new devices // Else it will find the device with the topic and call the HandleMessage func (gw *Gateway) MQTTHandler(client mqtt.Client, msg mqtt.Message) { - // we ignore some topics - if slices.Contains(gw.Config.ignoredTopics, msg.Topic()) { - return - } // some messages are empty if len(msg.Payload()) == 0 { return } + // we ignore some topics + if slices.Contains(gw.Config.ignoredTopics, msg.Topic()) { + return + } // Is it devices definitions ? if msg.Topic() == gw.Config.topic+"/bridge/devices" { gw.Z2MParseDevices(msg) } else { zDev := gw.GetZDeviceByTopic(msg.Topic()) - // MQTTDumpMsg(msg) if zDev != nil { zDev.HandleMessage(msg) } -- GitLab