Avoid some mqtt server connection

Do not check subscription when we do not subscribe
This commit is contained in:
Mathieu Maret 2022-09-10 22:48:37 +02:00
parent 73d6e17dc1
commit 7b1d9ae63e
2 changed files with 7 additions and 4 deletions

View File

@ -197,7 +197,10 @@ void MqttCheckIRQ() {
} }
void MqttCheckSubscription() { void MqttCheckSubscription()
{
if (mqtt->getSubscriptionCount() == 0)
return;
if (MqttConnect() == 0) { if (MqttConnect() == 0) {
Adafruit_MQTT_Subscribe *subscription; Adafruit_MQTT_Subscribe *subscription;
while ((subscription = mqtt->readSubscription(0))) { while ((subscription = mqtt->readSubscription(0))) {

View File

@ -15,7 +15,7 @@ int TeleinfoSetup() {
inline int TeleinfoProcess(std::vector<struct mqttInfo> &){ inline int TeleinfoProcess(std::vector<struct mqttInfo> &){
return 0; return 0;
}; };
int TeleinfoProcess(float &iinst, float &papp, float &base){ int TeleinfoProcess(float &, float &, float &){
return 0; return 0;
}; };
#endif #endif