Skip to content
Snippets Groups Projects
Commit 22dcfbc9 authored by drlobo's avatar drlobo
Browse files

Added Authentication settings

parent 889df3f5
Branches
Tags
No related merge requests found
...@@ -32,3 +32,14 @@ msgctxt "#30013" ...@@ -32,3 +32,14 @@ msgctxt "#30013"
msgid "MQTT Topic Prefix" msgid "MQTT Topic Prefix"
msgstr "" msgstr ""
msgctxt "#31000"
msgid "Authentication"
msgstr ""
msgctxt "#31001"
msgid "MQTT Username"
msgstr ""
msgctxt "#31002"
msgid "MQTT Password"
msgstr ""
...@@ -5,4 +5,8 @@ ...@@ -5,4 +5,8 @@
<setting label="30012" type="number" id="mqttport" default="1883"/> <setting label="30012" type="number" id="mqttport" default="1883"/>
<setting label="30013" type="text" id="mqtttopic" default="kodi/"/> <setting label="30013" type="text" id="mqtttopic" default="kodi/"/>
</category> </category>
<category label="31000">
<setting label="31001" type="text" id="mqttusername" default=""/>
<setting label="31002" type="text" id="mqttpassword" option="hidden" default=""/>
</category>
</settings> </settings>
...@@ -207,6 +207,8 @@ def startmqtt(): ...@@ -207,6 +207,8 @@ def startmqtt():
mqc.on_message=msghandler mqc.on_message=msghandler
mqc.on_connect=connecthandler mqc.on_connect=connecthandler
mqc.on_disconnect=disconnecthandler mqc.on_disconnect=disconnecthandler
if __addon__.getSetting("mqttusername")!='':
mqc.username_pw_set(__addon__.getSetting("mqttusername"), __addon__.getSetting("mqttpassword"))
topic=__addon__.getSetting("mqtttopic") topic=__addon__.getSetting("mqtttopic")
if not topic.endswith("/"): if not topic.endswith("/"):
topic+="/" topic+="/"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment