Added EventSource for webUI updates, completed more features

This commit is contained in:
Djuri 2023-11-08 15:27:22 +01:00
parent 91fd921e2e
commit 280764a2fa
16 changed files with 241 additions and 78 deletions

View file

@ -32,7 +32,7 @@ void setupBlockNotify()
{
String blockHeightStr = http->getString();
currentBlockHeight = blockHeightStr.toInt();
xTaskNotifyGive(blockUpdateTaskHandle);
// xTaskNotifyGive(blockUpdateTaskHandle);
}
// std::strcpy(wsServer, String("wss://" + mempoolInstance + "/api/v1/ws").c_str());
@ -95,7 +95,10 @@ void onWebsocketMessage(esp_websocket_event_data_t *event_data)
if (blockUpdateTaskHandle != nullptr) {
xTaskNotifyGive(blockUpdateTaskHandle);
queueLedEffect(LED_FLASH_BLOCK_NOTIFY);
if (preferences.getBool("ledFlashOnUpd", false)) {
vTaskDelay(pdMS_TO_TICKS(250)); // Wait until screens are updated
queueLedEffect(LED_FLASH_BLOCK_NOTIFY);
}
}
}