Merge remote branch 'go-rewrite' into go-rewrite
This commit is contained in:
commit
c50d17a497
@ -57,6 +57,6 @@ func InitBoards() {
|
||||
var b board.Board
|
||||
for i := range boards {
|
||||
b = *boards[i]
|
||||
b.Initialize()
|
||||
go b.Initialize()
|
||||
}
|
||||
}
|
||||
|
@ -90,12 +90,18 @@ func Disconnect() {
|
||||
}
|
||||
|
||||
func Publish(topic string, value string) {
|
||||
if MQTTclient == nil {
|
||||
return
|
||||
}
|
||||
if MQTTclient.IsConnected() {
|
||||
MQTTclient.Publish(viper.GetString("Mqtt.Prefix")+"/switch/"+topic, 0, false, value)
|
||||
}
|
||||
}
|
||||
|
||||
func PublishRoot(topic string, value string) {
|
||||
if MQTTclient == nil {
|
||||
return
|
||||
}
|
||||
if MQTTclient.IsConnected() {
|
||||
MQTTclient.Publish(topic, 0, false, value)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user