Skip to content

Commit

Permalink
feature: add support for specifying the mqtt password (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbender9 authored Aug 5, 2024
1 parent 70d44e9 commit a7fc09e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ module.exports = function (app) {
type: 'string',
title: 'Venus MQTT Host',
default: 'venus.local'
},
password: {
type: 'string',
title: 'Venus MQTT Password',
}
}
},
Expand Down Expand Up @@ -179,6 +183,17 @@ module.exports = function (app) {
}
}

plugin.uiSchema = () => {
return {
MQTT: {
password: {
'ui:widget': 'password'
}
}
}
}


function handleMessage (delta) {
app.handleMessage(PLUGIN_ID, delta)
}
Expand Down Expand Up @@ -384,7 +399,9 @@ module.exports = function (app) {
app.debug('using mqtt url %s', url)

var client = mqtt.connect(url, {
rejectUnauthorized: false
rejectUnauthorized: true,
username: '',
password: options.MQTT.password
})
plugin.client = client

Expand Down

0 comments on commit a7fc09e

Please sign in to comment.