mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-29 10:16:21 +02:00
setupMqtt better reading
This commit is contained in:
parent
fd1963efff
commit
6f86557446
1 changed files with 3 additions and 18 deletions
|
@ -821,11 +821,10 @@ void app::setupMqtt(void) {
|
|||
if(mSettingsValid) {
|
||||
if(mConfig.mqtt.broker[0] > 0) {
|
||||
mMqttActive = true;
|
||||
if(mMqttInterval < MIN_MQTT_INTERVAL)
|
||||
mMqttInterval = MIN_MQTT_INTERVAL;
|
||||
}
|
||||
else
|
||||
if(mMqttInterval < MIN_MQTT_INTERVAL) mMqttInterval = MIN_MQTT_INTERVAL;
|
||||
} else {
|
||||
mMqttInterval = 0xffff;
|
||||
}
|
||||
|
||||
mMqttTicker = 0;
|
||||
mMqtt.setup(&mConfig.mqtt, mSysConfig.deviceName);
|
||||
|
@ -838,20 +837,6 @@ void app::setupMqtt(void) {
|
|||
mMqtt.sendMsg("device", mSysConfig.deviceName);
|
||||
mMqtt.sendMsg("uptime", "0");
|
||||
}
|
||||
|
||||
/*char topic[30];
|
||||
for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i ++) {
|
||||
iv = mSys->getInverterByPos(i);
|
||||
if(NULL != iv) {
|
||||
for(uint8_t i = 0; i < 4; i++) {
|
||||
if(0 != iv->chName[i][0]) {
|
||||
snprintf(topic, 30, "%s/ch%d/%s", iv->name, i+1, "name");
|
||||
mMqtt.sendMsg(topic, iv->chName[i]);
|
||||
yield();
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue