version with cloud_topic
This commit is contained in:
parent
31b5dbba5c
commit
41d1ec28dd
10 changed files with 264 additions and 350 deletions
|
|
@ -4,7 +4,7 @@ exports.group = 'MQTT';
|
|||
exports.color = '#888600';
|
||||
exports.version = '1.0.2';
|
||||
exports.icon = 'sign-out';
|
||||
exports.input = 1;
|
||||
exports.input = 2;
|
||||
exports.output = 2;
|
||||
exports.options = { host: 'tb-stage.worksys.io', port: 1883, clientid: "", username: "" };
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ exports.html = `<div class="padding">
|
|||
<div data-jc="textbox" data-jc-path="clientid">@(Client id)</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div data-jc="textbox" data-jc-path="topic" data-jc-config="required:true" class="m">topic</div>
|
||||
<div data-jc="textbox" data-jc-path="topic" class="m">topic</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
|
@ -77,6 +77,8 @@ exports.install = function(instance) {
|
|||
{
|
||||
|
||||
o = instance.options;
|
||||
if(!o.topic) o.topic = FLOW.GLOBALS.settings.cloud_topic;
|
||||
|
||||
opts = {
|
||||
host: o.host,
|
||||
port: o.port,
|
||||
|
|
@ -86,8 +88,7 @@ exports.install = function(instance) {
|
|||
resubscribe: false
|
||||
};
|
||||
|
||||
|
||||
console.log("wsmqttpublich -> loadSettings from instance.options", instance.options);
|
||||
console.log("wsmqttpublich -> loadSettings from instance.options",o);
|
||||
|
||||
connectToTbServer();
|
||||
}
|
||||
|
|
@ -212,6 +213,9 @@ exports.install = function(instance) {
|
|||
}
|
||||
});
|
||||
|
||||
instance.on("1", _ => {
|
||||
main();
|
||||
})
|
||||
|
||||
instance.close = function(done) {
|
||||
if(clientReady){
|
||||
|
|
@ -399,6 +403,5 @@ exports.install = function(instance) {
|
|||
}
|
||||
|
||||
instance.on('options', main);
|
||||
main();
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue