lot of changes for first actual use
This commit is contained in:
25
src/main.ts
25
src/main.ts
@ -3,23 +3,20 @@ import * as mqtt from './mqttdispatcher'
|
||||
import * as callchain from './callchain'
|
||||
import * as plugintest1 from './plugintest1'
|
||||
|
||||
import * as EspThermToJson from './espthermtojson'
|
||||
import * as MongoSave from './mongosave'
|
||||
|
||||
log.info("Dispatcher starting")
|
||||
export const dispatcher = new mqtt.MqttDispatcher()
|
||||
dispatcher.register('IoT/test', 'print1', (message: any) : any => {
|
||||
log.info("Callback for IoT/test")
|
||||
log.info(`message is ${message}`)
|
||||
return `<<${message}>>`
|
||||
})
|
||||
dispatcher.register('IoT/test', 'print2', (message: any) : any => {
|
||||
log.info("Callback for IoT/test")
|
||||
log.info(`message is ${message}`)
|
||||
return `<<${message}>>`
|
||||
})
|
||||
dispatcher.register('IoT/test', 'null1', mqtt.passThrough)
|
||||
dispatcher.register('IoT/test', 'null2', mqtt.passThrough)
|
||||
let dispatcher = new mqtt.MqttDispatcher("mqtts://broker.hottis.de:8883",
|
||||
"wn", "locutus", "/home/wn/server-ca.crt")
|
||||
|
||||
plugintest1.pluginTest1Start(dispatcher)
|
||||
dispatcher.register('IoT/espThermometer2/#', 'toJson', EspThermToJson.espThermToJson)
|
||||
|
||||
let mongo : MongoSave.MongoSave = new MongoSave.MongoSave()
|
||||
dispatcher.register('IoT/espThermometer2/#', 'MongoSave', mongo);
|
||||
|
||||
|
||||
// plugintest1.pluginTest1Start(dispatcher)
|
||||
|
||||
dispatcher.exec()
|
||||
log.info("Dispatcher running")
|
||||
|
Reference in New Issue
Block a user