2023-11-07 01:11:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
#include <ArduinoJson.h>
|
2023-11-30 22:56:50 +01:00
|
|
|
#include <esp_websocket_client.h>
|
2024-05-09 01:02:40 +02:00
|
|
|
#include "block_notify.hpp"
|
2023-11-30 22:38:01 +01:00
|
|
|
#include <string>
|
2023-11-07 01:11:12 +01:00
|
|
|
|
2023-11-30 22:38:01 +01:00
|
|
|
#include "lib/screen_handler.hpp"
|
2023-11-07 01:11:12 +01:00
|
|
|
|
|
|
|
void setupPriceNotify();
|
|
|
|
|
2023-11-30 22:38:01 +01:00
|
|
|
void onWebsocketPriceEvent(void *handler_args, esp_event_base_t base,
|
|
|
|
int32_t event_id, void *event_data);
|
2024-09-11 03:23:41 +02:00
|
|
|
//void onWebsocketPriceEvent(WStype_t type, uint8_t * payload, size_t length);
|
|
|
|
|
2023-11-30 22:38:01 +01:00
|
|
|
void onWebsocketPriceMessage(esp_websocket_event_data_t *event_data);
|
2023-11-07 01:11:12 +01:00
|
|
|
|
2024-09-05 14:00:15 +02:00
|
|
|
uint getPrice(char currency);
|
|
|
|
void setPrice(uint newPrice, char currency);
|
2023-11-12 12:38:28 +01:00
|
|
|
|
2024-09-05 14:00:15 +02:00
|
|
|
//void processNewPrice(uint newPrice);
|
|
|
|
void processNewPrice(uint newPrice, char currency);
|
2024-07-11 22:08:42 +02:00
|
|
|
|
2023-11-10 23:18:14 +01:00
|
|
|
bool isPriceNotifyConnected();
|
2024-01-31 23:45:26 +01:00
|
|
|
void stopPriceNotify();
|
2024-04-16 15:17:34 +02:00
|
|
|
void restartPriceNotify();
|
|
|
|
|
2024-03-17 23:16:15 +01:00
|
|
|
bool getPriceNotifyInit();
|
2024-09-05 14:00:15 +02:00
|
|
|
uint getLastPriceUpdate(char currency);
|