From 3e2954694aab87d8eeda170425a20a8b5b334a28 Mon Sep 17 00:00:00 2001 From: nymea Date: Tue, 14 May 2019 19:04:11 +0200 Subject: [PATCH] added coin market cap --- coinmarketcap/deviceplugincoinmarketcap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coinmarketcap/deviceplugincoinmarketcap.cpp b/coinmarketcap/deviceplugincoinmarketcap.cpp index ce468653..6d1a20a7 100644 --- a/coinmarketcap/deviceplugincoinmarketcap.cpp +++ b/coinmarketcap/deviceplugincoinmarketcap.cpp @@ -31,7 +31,7 @@ DevicePluginCoinMarketCap::DevicePluginCoinMarketCap() DeviceManager::DeviceSetupStatus DevicePluginCoinMarketCap::setupDevice(Device *device) { if(!m_pluginTimer) { - m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(60); + m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(10); connect(m_pluginTimer, &PluginTimer::timeout, this, &DevicePluginCoinMarketCap::onPluginTimer); } @@ -82,12 +82,12 @@ void DevicePluginCoinMarketCap::onPriceCallFinished() qCWarning(dcCoinMarketCap()) << "Request error:" << status << reply->errorString(); device->setStateValue(currentPricesConnectedStateTypeId, false); } - reply->deleteLater(); // check JSON file QJsonParseError error; QJsonDocument jsonResponse = QJsonDocument::fromJson(reply->readAll(), &error); - qDebug(dcCoinMarketCap()) << jsonResponse; + reply->deleteLater(); + if (error.error != QJsonParseError::NoError) { qCWarning(dcCoinMarketCap()) << "Update reply JSON error:" << error.errorString(); reply->deleteLater();