diff --git a/.gitignore b/.gitignore index 9bea433..a965236 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store +/ESPMegaPRO-OS-SDK diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaIoT.cpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaIoT.cpp index 80fd0d3..2b9c877 100644 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaIoT.cpp +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaIoT.cpp @@ -56,6 +56,16 @@ void ESPMegaIoT::mqttCallback(char *topic, byte *payload, unsigned int length) { callback.second(topic_without_base, payload_buffer); } + // Check for global state request + if (!strcmp(topic_without_base,"requeststate")) { + for (int i = 0; i < 255; i++) + { + if (components[i] != NULL) + { + components[i]->publishReport(); + } + } + } // Call the respective card's mqtt callback // Note that after the base topic, there should be the card id // /base_topic/card_id/...