global state request
This commit is contained in:
parent
6b67591cc1
commit
ea49576b20
|
@ -1,2 +1,3 @@
|
|||
|
||||
.DS_Store
|
||||
/ESPMegaPRO-OS-SDK
|
||||
|
|
|
@ -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/...
|
||||
|
|
Loading…
Reference in New Issue