mirror of
https://github.com/BitMaker-hub/NerdMiner_v2.git
synced 2025-03-29 19:22:04 +01:00
Update monitor.cpp
all credits to this changes for https://github.com/ChimpRocket
This commit is contained in:
parent
53157f1ecf
commit
496fcecc7d
@ -152,7 +152,7 @@ String getBTCprice(void){
|
||||
|
||||
if((mBTCUpdate == 0) || (millis() - mBTCUpdate > UPDATE_BTC_min * 60 * 1000)){
|
||||
|
||||
if (WiFi.status() != WL_CONNECTED) return (String(bitcoin_price) + "$");
|
||||
if (WiFi.status() != WL_CONNECTED) return "$" + String(bitcoin_price);
|
||||
|
||||
HTTPClient http;
|
||||
try {
|
||||
@ -164,7 +164,7 @@ String getBTCprice(void){
|
||||
|
||||
DynamicJsonDocument doc(1024);
|
||||
deserializeJson(doc, payload);
|
||||
if (doc.containsKey("last_trade_price")) bitcoin_price = doc["last_trade_price"];
|
||||
if (doc.containsKey("data") && doc["data"].containsKey("amount")) bitcoin_price = doc["data"]["amount"];
|
||||
|
||||
doc.clear();
|
||||
|
||||
@ -177,7 +177,7 @@ String getBTCprice(void){
|
||||
}
|
||||
}
|
||||
|
||||
return (String(bitcoin_price) + "$");
|
||||
return "$" + String(bitcoin_price);
|
||||
}
|
||||
|
||||
unsigned long mTriggerUpdate = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user