MQTT#Connected and MQTTimport#Connected

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
pw444
Normal user
Posts: 155
Joined: 23 Apr 2019, 15:34
Location: rio de janeiro

MQTT#Connected and MQTTimport#Connected

#1 Post by pw444 » 31 Dec 2020, 20:52

Hya,

while digging the documentation, i've found MQTT#Connected and MQTTimport#Connected

Whats is the difference between these, and when, according the developers, shall one or other be used and which are the benefits?

Thx in advance.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: MQTT#Connected and MQTTimport#Connected

#2 Post by Ath » 01 Jan 2021, 11:28

They used to be triggered by different connection-clients, but now that MQTT Import is 'piggy-backing' on the regular (first enabled) MQTT Controller connection, they are practically the same. For backward compatibility, the MQTTImport events still exist, and one can choose to use that where appropriate, plus, they won't be fired while the MQTT Import plugin task is disabled (which can be enabled/disabled from the rules), so having separate events is useful, IMHO. And, you can decide what best fits you application.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MQTT#Connected and MQTTimport#Connected

#3 Post by TD-er » 01 Jan 2021, 12:37

Yep, what Ton said.

MQTT#connected/disconnected are events originally only related to the MQTT controllers.
MQTTimpor#connected/disconnected are events originally related to the MQTT import plugin.

A few weeks ago I changed the code so MQTT import uses the same MQTT client as the controller (since they already shared the same credentials) to save resources as each MQTT client instance uses over a kB of RAM.

pw444
Normal user
Posts: 155
Joined: 23 Apr 2019, 15:34
Location: rio de janeiro

Re: MQTT#Connected and MQTTimport#Connected

#4 Post by pw444 » 01 Jan 2021, 15:17

Thx for the explanation.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests