add json config

This commit is contained in:
2018-11-19 10:24:18 +01:00
parent e08ac6eb6f
commit 30ad1041cb
2 changed files with 2 additions and 2 deletions

View File

@@ -7,11 +7,11 @@ MqttPlugin::MqttPlugin(MqttConfig cfg)
mqttConfig.clientName = cfg.clientName;
mqttConfig.inTopicRoot = cfg.inTopicRoot;
mqttConfig.outTopicRoot = cfg.outTopicRoot;
mqttConfig.fromFile("/mqttConfig.json");
}
void MqttPlugin::activate(Scheduler *scheduler)
{
mqttConfig.fromFile("/mqttConfig.json");
client = new PubSubClient(mqttConfig.brokerHost, mqttConfig.brokerPort, bind(&MqttPlugin::downstreamHandler, this, _1, _2, _3), wifiClient);
enableConnectTask(scheduler);
enableProcessTask(scheduler);