Skip to content

Commit

Permalink
修复没有连接MQTT下载HA配置文件错误
Browse files Browse the repository at this point in the history
  • Loading branch information
qlwz committed Feb 17, 2020
1 parent 28480ad commit f5d2244
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/esp_framework/src/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ void Framework::setup()
}
else
{
Mqtt::setClient(Wifi::wifiClient);
Mqtt::mqttSetConnectedCallback(connectedCallback);
Mqtt::mqttSetLoopCallback(callback);
module->init();
tickerPerSecond = new Ticker();
tickerPerSecond->attach(1, tickerPerSecondDo);
Http::begin();
Wifi::connectWifi();
Rtc::init();
Mqtt::setClient(Wifi::wifiClient);
Mqtt::mqttSetConnectedCallback(connectedCallback);
Mqtt::mqttSetLoopCallback(callback);
}
}

Expand Down
2 changes: 1 addition & 1 deletion nanopb/DC1Config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ message DC1ConfigMessage {
uint32 energy_kWhtoday = 25 [(nanopb).int_size = IS_64];
uint32 energy_kWhyesterday = 26 [(nanopb).int_size = IS_64];
uint32 energy_kWhtotal = 27 [(nanopb).int_size = IS_64];
uint32 energy_kWhdoy = 28 [(nanopb).int_size = IS_16];
uint32 energy_kWhdoy = 28 [(nanopb).int_size = IS_16];
uint32 energy_kWhtotal_time = 29 [(nanopb).int_size = IS_32];

}
2 changes: 1 addition & 1 deletion src/DC1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void DC1::init()
}
}
energyInit();
powerTopic = Mqtt::getStatTopic(F("POWER"));
}

bool DC1::moduleLed()
Expand Down Expand Up @@ -158,7 +159,6 @@ void DC1::mqttCallback(String topicStr, String str)

void DC1::mqttConnected()
{
powerTopic = Mqtt::getStatTopic(F("POWER"));
if (globalConfig.mqtt.discovery)
{
mqttDiscovery(true);
Expand Down

0 comments on commit f5d2244

Please sign in to comment.