Add clientid to config
Allow the ability to configure the clientid in the configuration file
This commit is contained in:
parent
fb1dae7a85
commit
adebdb00ff
|
@ -130,6 +130,9 @@ func (c *Config) ReadFile(filename string) error {
|
|||
if val := mqtt.Key("remote").String(); val != "" {
|
||||
c.mqttRemote = val
|
||||
}
|
||||
if val := mqtt.Key("clientid").String(); val != "" {
|
||||
c.mqttClientId = val
|
||||
}
|
||||
www := cfg.Section("www")
|
||||
if val := www.Key("remote").String(); val != "" {
|
||||
c.wwwDir = val
|
|
@ -117,6 +117,7 @@ func (mqtt *MQTTReceiver) mqttConnectionLost(client MQTT.Client, err error) {
|
|||
if token.Wait() {
|
||||
break
|
||||
}
|
||||
time.Sleep(2 * time.Second)
|
||||
}
|
||||
log.Printf("MQTT connection %s established", remote)
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
[mqtt]
|
||||
remote = 127.0.0.1
|
||||
clientid = ot-browser
|
||||
|
||||
[www]
|
||||
dir = ./www
|
||||
|
|
Loading…
Reference in a new issue