added README

master
nymea 2019-07-26 16:24:59 +02:00 committed by Michael Zanetti
parent e005906eb0
commit 316f1ac68c
2 changed files with 6 additions and 21 deletions

4
coinmarketcap/README.md Normal file
View File

@ -0,0 +1,4 @@
#CoinMarketCap
The coin market cap plugin gets the latest crypto prices from coin market cap and displays it in your favorite fiat currency.

View File

@ -18,23 +18,6 @@
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\page coinmarketcap.html
\title coin market cap
\brief Plugin to get the latest crypto prices.
\ingroup plugins
The coin market cap plugin gets the latest crypto prices from coin market cap and displays it in your favourite fiat currency.
\chapter Plugin properties
Following JSON file contains the definition and the description of all available \l{DeviceClass}{DeviceClasses}
and \l{Vendor}{Vendors} of this \l{DevicePlugin}.
For more details how to read this JSON file please check out the documentation for \l{The plugin JSON File}.
\quotefile plugins/deviceplugins/coinmarketcap/deviceplugincoinmarketcap.json
*/
#include "deviceplugincoinmarketcap.h"
#include "network/networkaccessmanager.h"
@ -85,11 +68,11 @@ void DevicePluginCoinMarketCap::onPluginTimer()
void DevicePluginCoinMarketCap::onPriceCallFinished()
{
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
qCDebug(dcCoinMarketCap()) << "GET reply finished";
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (!m_httpRequests.contains(reply)) {
reply->deleteLater();
return;
}
@ -104,11 +87,9 @@ void DevicePluginCoinMarketCap::onPriceCallFinished()
// check JSON file
QJsonParseError error;
QJsonDocument jsonResponse = QJsonDocument::fromJson(reply->readAll(), &error);
reply->deleteLater();
if (error.error != QJsonParseError::NoError) {
qCWarning(dcCoinMarketCap()) << "Update reply JSON error:" << error.errorString();
reply->deleteLater();
return;
}