Browse Source

Fix typo in mqtt reports. Added MQTT_RELAY_REPORT

fastled
Xose Pérez 7 years ago
parent
commit
4c6e1199dd
2 changed files with 10 additions and 6 deletions
  1. +2
    -1
      code/espurna/config/general.h
  2. +8
    -5
      code/espurna/espurna.ino

+ 2
- 1
code/espurna/config/general.h View File

@ -174,8 +174,9 @@
#define MQTT_UPTIME_REPORT 4
#define MQTT_FREEHEAP_REPORT 8
#define MQTT_VCC_REPORT 16
#define MQTT_RELAY_REPORT 32
#define MQTT_REPORTS (MQTT_STATUS_REPORT | MQTT_UPTIME_REPORT | MQTT_FREEHEAP_REPORT)
#define MQTT_REPORTS (MQTT_STATUS_REPORT | MQTT_UPTIME_REPORT | MQTT_FREEHEAP_REPORT | MQTT_RELAY_REPORT)
// -----------------------------------------------------------------------------
// I2C


+ 8
- 5
code/espurna/espurna.ino View File

@ -59,19 +59,22 @@ void hardwareLoop() {
DEBUG_MSG("[MAIN] Power: %d mV\n", ESP.getVcc());
#endif
#if (MQTT_REPORTS | MQTT_STATUS_REPORT)
#if (MQTT_REPORTS & MQTT_STATUS_REPORT)
mqttSend(MQTT_STATUS_TOPIC, "1");
#endif
#if (MQTT_REPORTS | MQTT_IP_REPORT)
#if (MQTT_REPORTS & MQTT_IP_REPORT)
mqttSend(MQTT_IP_TOPIC, getIP().c_str());
#endif
#if (MQTT_REPORTS | MQTT_UPTIME_REPORT)
#if (MQTT_REPORTS & MQTT_UPTIME_REPORT)
mqttSend(MQTT_UPTIME_TOPIC, String(uptime_seconds).c_str());
#endif
#if (MQTT_REPORTS | MQTT_FREEHEAP_REPORT)
#if (MQTT_REPORTS & MQTT_FREEHEAP_REPORT)
mqttSend(MQTT_FREEHEAP_TOPIC, String(ESP.getFreeHeap()).c_str());
#endif
#if (MQTT_REPORTS | MQTT_VCC_REPORT)
#if (MQTT_REPORTS & MQTT_RELAY_REPORT)
relayMQTT();
#endif
#if (MQTT_REPORTS & MQTT_VCC_REPORT)
#if ENABLE_ADC_VCC
mqttSend(MQTT_VCC_TOPIC, String(ESP.getVcc()).c_str());
#endif


Loading…
Cancel
Save