Remove deprecated ArduinoJson methods

This commit is contained in:
Djuri 2025-01-05 23:13:05 +01:00
parent 178748b94d
commit 0999dd08ad
Signed by: djuri
GPG key ID: 61B9B2DDE5AA3AC1
3 changed files with 10 additions and 31 deletions

View file

@ -127,7 +127,7 @@ namespace V2Notify
void handleV2Message(JsonDocument doc)
{
if (doc.containsKey("blockheight"))
if (doc["blockheight"].is<JsonObject>())
{
uint newBlockHeight = doc["blockheight"].as<uint>();
@ -138,13 +138,13 @@ namespace V2Notify
processNewBlock(newBlockHeight);
}
else if (doc.containsKey("blockfee"))
else if (doc["blockfee"].is<JsonObject>())
{
uint medianFee = doc["blockfee"].as<uint>();
processNewBlockFee(medianFee);
}
else if (doc.containsKey("price"))
else if (doc["price"].is<JsonObject>())
{
// Iterate through the key-value pairs of the "price" object