Merge PR #257: CoinMarketCap: New API

master
Jenkins nymea 2020-04-14 17:29:26 +02:00
commit c0f0e4d157
5 changed files with 393 additions and 107 deletions

View File

@ -38,18 +38,62 @@ IntegrationPluginCoinMarketCap::IntegrationPluginCoinMarketCap()
{
}
void IntegrationPluginCoinMarketCap::startPairing(ThingPairingInfo *info)
{
NetworkAccessManager *network = hardwareManager()->networkManager();
QNetworkReply *reply = network->get(QNetworkRequest(QUrl("https://pro-api.coinmarketcap.com")));
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
connect(reply, &QNetworkReply::finished, this, [this, reply, info] {
if (reply->error() == QNetworkReply::NetworkError::HostNotFoundError) {
info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("CoinMarketCap server is not reachable."));
} else {
info->finish(Thing::ThingErrorNoError, QT_TR_NOOP("Please enter your API token."));
}
});
}
void IntegrationPluginCoinMarketCap::confirmPairing(ThingPairingInfo *info, const QString &username, const QString &secret)
{
Q_UNUSED(username)
QNetworkRequest request(QUrl("https://pro-api.coinmarketcap.com/v1/key/info"));
request.setRawHeader("X-CMC_PRO_API_KEY", secret.toUtf8());
request.setRawHeader("Accept", "application/json");
QNetworkReply *reply = hardwareManager()->networkManager()->get(request);
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
connect(reply, &QNetworkReply::finished, info, [this, reply, info, secret](){
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
// check HTTP status code
if (status != 200) {
// Error setting up device with invalid token
info->finish(Thing::ThingErrorAuthenticationFailure, QT_TR_NOOP("This token is not valid."));
return;
}
pluginStorage()->beginGroup(info->thingId().toString());
pluginStorage()->setValue("apiKey", secret);
pluginStorage()->endGroup();
info->finish(Thing::ThingErrorNoError);
});
}
void IntegrationPluginCoinMarketCap::setupThing(ThingSetupInfo *info)
{
Thing *thing = info->thing();
if (thing->thingClassId() == currentPricesThingClassId) {
pluginStorage()->beginGroup(info->thing()->id().toString());
QByteArray apiKey = pluginStorage()->value("apiKey").toByteArray();
pluginStorage()->endGroup();
m_apiKeys.insert(thing->id(), apiKey);
getPriceCall(thing);
if(!m_pluginTimer) {
m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(10);
connect(m_pluginTimer, &PluginTimer::timeout, this, &IntegrationPluginCoinMarketCap::onPluginTimer);
}
info->finish(Thing::ThingErrorNoError);
return;
}
@ -59,18 +103,32 @@ void IntegrationPluginCoinMarketCap::setupThing(ThingSetupInfo *info)
void IntegrationPluginCoinMarketCap::thingRemoved(Thing *thing)
{
while (m_httpRequests.values().contains(thing)) {
QNetworkReply *reply = m_httpRequests.key(thing);
m_httpRequests.remove(reply);
reply->deleteLater();
if (thing->thingClassId() == currentPricesThingClassId) {
m_apiKeys.remove(thing->id());
while (m_httpRequests.values().contains(thing)) {
QNetworkReply *reply = m_httpRequests.key(thing);
m_httpRequests.remove(reply);
reply->deleteLater();
}
}
if (myThings().empty()) {
if (myThings().empty() && m_pluginTimer) {
hardwareManager()->pluginTimerManager()->unregisterTimer(m_pluginTimer);
m_pluginTimer = nullptr;
}
}
void IntegrationPluginCoinMarketCap::postSetupThing(Thing *thing)
{
Q_UNUSED(thing)
if(!m_pluginTimer) {
m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(120);
connect(m_pluginTimer, &PluginTimer::timeout, this, &IntegrationPluginCoinMarketCap::onPluginTimer);
}
}
void IntegrationPluginCoinMarketCap::onPluginTimer()
{
foreach (Thing *thing, myThings()) {
@ -83,7 +141,6 @@ void IntegrationPluginCoinMarketCap::onPluginTimer()
void IntegrationPluginCoinMarketCap::onPriceCallFinished()
{
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -108,58 +165,50 @@ void IntegrationPluginCoinMarketCap::onPriceCallFinished()
return;
}
QVariantList list = jsonResponse.toVariant().toList();
QVariantList list = jsonResponse.toVariant().toMap().value("data").toList();
foreach (QVariant element, list) {
QVariantMap elementMap = element.toMap();
thing->setStateValue(currentPricesConnectedStateTypeId, true);
double price;
if (elementMap.value("id").toString() == "bitcoin") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
qDebug(dcCoinMarketCap()) << "Bitcoin Price in" << QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower() << price;
QString fiatCurrency = thing->paramValue(currentPricesThingFiatParamTypeId).toString().toUpper();
qCDebug(dcCoinMarketCap()) << "Name" << elementMap.value("name").toString();
price = elementMap.value("quote").toMap().value(fiatCurrency).toMap().value("price").toDouble();
if (elementMap.value("name").toString() == "Bitcoin") {
qDebug(dcCoinMarketCap()) << "Bitcoin Price in" << fiatCurrency << price;
thing->setStateValue(currentPricesBtcStateTypeId, price);
} else if (elementMap.value("id").toString() == "ethereum") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
qDebug(dcCoinMarketCap()) << "Etherium Price in" << QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower() << price;
} else if (elementMap.value("name").toString() == "Ethereum") {
qDebug(dcCoinMarketCap()) << "Etherium Price in" << fiatCurrency << price;
thing->setStateValue(currentPricesEthStateTypeId, price);
} else if (elementMap.value("id").toString() == "ripple") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
qDebug(dcCoinMarketCap()) << "Ripple Price in" << QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower() << price;
} else if (elementMap.value("name").toString() == "XRP") {
qDebug(dcCoinMarketCap()) << "XRP Price in" << fiatCurrency << price;
thing->setStateValue(currentPricesXrpStateTypeId, price);
} else if (elementMap.value("id").toString() == "bitcoin-cash") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
qDebug(dcCoinMarketCap()) << "Bitcoin-cash Price in" << QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower() << price;
} else if (elementMap.value("name").toString() == "Bitcoin Cash") {
qDebug(dcCoinMarketCap()) << "Bitcoin-cash Price in" << fiatCurrency << price;
thing->setStateValue(currentPricesBchStateTypeId, price);
} else if (elementMap.value("id").toString() == "litecoin") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
qDebug(dcCoinMarketCap()) << "Litecoin Price in" << QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower() << price;
} else if (elementMap.value("name").toString() == "Litecoin") {
qDebug(dcCoinMarketCap()) << "Litecoin Price in" << fiatCurrency << price;
thing->setStateValue(currentPricesLtcStateTypeId, price);
} else if (elementMap.value("id").toString() == "nem") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
qDebug(dcCoinMarketCap()) << "Nem Price in" << QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower() << price;
} else if (elementMap.value("name").toString() == "NEM") {
qDebug(dcCoinMarketCap()) << "Nem Price in" << fiatCurrency << price;
thing->setStateValue(currentPricesXemStateTypeId, price);
} else if (elementMap.value("id").toString() == "ethereum-classic") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
qDebug(dcCoinMarketCap()) << "Ethereum Classic Price in" << QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower() << price;
} else if (elementMap.value("name").toString() == "Ethereum Classic") {
qDebug(dcCoinMarketCap()) << "Ethereum Classic Price in" << fiatCurrency << price;
thing->setStateValue(currentPricesEtcStateTypeId, price);
} else if (elementMap.value("id").toString() == "dash") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
} else if (elementMap.value("name").toString() == "Dash") {
thing->setStateValue(currentPricesDashStateTypeId, price);
} else if (elementMap.value("id").toString() == "iota") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
} else if (elementMap.value("name").toString() == "IOTA") {
thing->setStateValue(currentPricesMiotaStateTypeId, price);
} else if (elementMap.value("id").toString() == "neo") {
price = elementMap.value(QString("price_%1").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower())).toDouble();
} else if (elementMap.value("name").toString() == "Neo") {
thing->setStateValue(currentPricesAnsStateTypeId, price);
}
}
@ -168,12 +217,16 @@ void IntegrationPluginCoinMarketCap::onPriceCallFinished()
void IntegrationPluginCoinMarketCap::getPriceCall(Thing *thing)
{
QUrl url;
url.setUrl(QString("https://api.coinmarketcap.com/v1/ticker/?convert=%1&limit=30").arg(QString(thing->paramValue(currentPricesThingFiatParamTypeId).toString()).toLower()));
QString fiatCurrency = thing->paramValue(currentPricesThingFiatParamTypeId).toString().toUpper();
url.setUrl(QString("https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?convert=%1&start=1&limit=30").arg(fiatCurrency));
QNetworkRequest request;
request.setUrl(url);
request.setRawHeader("X-CMC_PRO_API_KEY", m_apiKeys.value(thing->id()));
request.setRawHeader("Accept", "application/json");
request.setRawHeader("User-Agent", "nymea 1.0");
qCDebug(dcCoinMarketCap()) << "Sending request" << url << "API key" << m_apiKeys.value(thing->id());
QNetworkReply *reply = hardwareManager()->networkManager()->get(request);
connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater);
connect(reply, &QNetworkReply::finished, this, &IntegrationPluginCoinMarketCap::onPriceCallFinished);
m_httpRequests.insert(reply, thing);

View File

@ -47,11 +47,15 @@ class IntegrationPluginCoinMarketCap : public IntegrationPlugin
public:
explicit IntegrationPluginCoinMarketCap();
void startPairing(ThingPairingInfo *info) override;
void confirmPairing(ThingPairingInfo *info, const QString &username, const QString &secret) override;
void setupThing(ThingSetupInfo *info) override;
void thingRemoved(Thing *thing) override;
void postSetupThing(Thing *thing) override;
private:
PluginTimer *m_pluginTimer = nullptr;
QHash<ThingId, QByteArray> m_apiKeys;
QHash<QUrl, Thing *> m_priceRequests;
QHash<QNetworkReply *, Thing *> m_httpRequests;

View File

@ -1,10 +1,10 @@
{
"displayName": "Coin market cap",
"displayName": "CoinMarketCap",
"name": "coinMarketCap",
"id": "532757cf-fc6f-4ce5-ae5b-e6f5bdb67fb4",
"vendors": [
{
"displayName": "Coin Market Cap",
"displayName": "CoinMarketCap",
"name": "coinMarketCap",
"id": "28eeecbd-4178-45aa-81a6-fd95851444fd",
"thingClasses": [
@ -14,6 +14,7 @@
"displayName": "Crypto Prices",
"createMethods": ["user"],
"interfaces": ["connectable"],
"setupMethod": "displaypin",
"paramTypes": [
{
"id": "92747d75-d18a-4915-bd48-0edd5cc5f19a",
@ -55,7 +56,7 @@
"displayName": "Bitcoin",
"type": "double",
"defaultValue": 0.00,
"displayNameEvent": "bitcoin value changed"
"displayNameEvent": "Bitcoin value changed"
},
{
"id": "5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824",
@ -63,15 +64,15 @@
"displayName": "Ethereum",
"type": "double",
"defaultValue": 0.00,
"displayNameEvent": "ethereum value changed"
"displayNameEvent": "Ethereum value changed"
},
{
"id": "d8517cf8-2ebd-4be3-8573-00b595cc2ab5",
"name": "xrp",
"displayName": "Ripple",
"displayName": "XRP",
"type": "double",
"defaultValue": 0.00,
"displayNameEvent": "ripple value changed"
"displayNameEvent": "XRP value changed"
},
{
"id": "cc5b4fe5-aa43-43b3-952f-90c0e3e20740",
@ -79,7 +80,7 @@
"displayName": "Bitcoin Cash",
"type": "double",
"defaultValue": 0.00,
"displayNameEvent": "bitcoin cash value changed"
"displayNameEvent": "Bitcoin Cash value changed"
},
{
"id": "f591f699-ae68-4f64-a221-254f836a31d3",
@ -95,7 +96,7 @@
"displayName": "NEM",
"type": "double",
"defaultValue": 0.00,
"displayNameEvent": "NEM cash value changed"
"displayNameEvent": "NEM value changed"
},
{
"id": "fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2",
@ -103,7 +104,7 @@
"displayName": "Ethereum Classic",
"type": "double",
"defaultValue": 0.00,
"displayNameEvent": "etherium classic value changed"
"displayNameEvent": "Etherium Classic value changed"
},
{
"id": "0b602f14-1596-4091-a0ab-6c5efa087a3f",

View File

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<context>
<name>IntegrationPluginCoinMarketCap</name>
<message>
<location filename="../integrationplugincoinmarketcap.cpp" line="50"/>
<source>CoinMarketCap server is not reachable.</source>
<translation>Der CoinMarketCap-Server ist nicht erreichbar.</translation>
</message>
<message>
<location filename="../integrationplugincoinmarketcap.cpp" line="52"/>
<source>Please enter your API token.</source>
<translation>Bitte geben Sie Ihr API-Token ein.</translation>
</message>
<message>
<location filename="../integrationplugincoinmarketcap.cpp" line="74"/>
<source>This token is not valid.</source>
<extracomment>Error setting up device with invalid token</extracomment>
<translation>Dieser Token ist ungültig.</translation>
</message>
</context>
<context>
<name>coinMarketCap</name>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="57"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="60"/>
<source>Bitcoin</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: btc, ID: {721c91c8-8eb1-402e-8bfc-8e2d496be032})
----------
The name of the StateType ({721c91c8-8eb1-402e-8bfc-8e2d496be032}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="63"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="66"/>
<source>Bitcoin Cash</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: bch, ID: {cc5b4fe5-aa43-43b3-952f-90c0e3e20740})
----------
The name of the StateType ({cc5b4fe5-aa43-43b3-952f-90c0e3e20740}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="69"/>
<source>Bitcoin Cash value changed</source>
<extracomment>The name of the EventType ({cc5b4fe5-aa43-43b3-952f-90c0e3e20740}) of ThingClass currentPrices</extracomment>
<translation>Bitcoin Cash Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="72"/>
<source>Bitcoin value changed</source>
<extracomment>The name of the EventType ({721c91c8-8eb1-402e-8bfc-8e2d496be032}) of ThingClass currentPrices</extracomment>
<translation>Bitcoin Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="75"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="78"/>
<source>CoinMarketCap</source>
<extracomment>The name of the vendor ({28eeecbd-4178-45aa-81a6-fd95851444fd})
----------
The name of the plugin coinMarketCap ({532757cf-fc6f-4ce5-ae5b-e6f5bdb67fb4})</extracomment>
<translation>CoinMarketCap</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="81"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="84"/>
<source>Connected</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: connected, ID: {19f079f0-1654-44c3-ab10-e7d7f9742e09})
----------
The name of the StateType ({19f079f0-1654-44c3-ab10-e7d7f9742e09}) of ThingClass currentPrices</extracomment>
<translation>Verbunden</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="87"/>
<source>Connection status changed</source>
<extracomment>The name of the EventType ({19f079f0-1654-44c3-ab10-e7d7f9742e09}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="90"/>
<source>Crypto Prices</source>
<extracomment>The name of the ThingClass ({f5b794f7-7e2a-4409-8445-23ead80f2a8f})</extracomment>
<translation>Verbunden geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="93"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="96"/>
<source>Dash</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: dash, ID: {0b602f14-1596-4091-a0ab-6c5efa087a3f})
----------
The name of the StateType ({0b602f14-1596-4091-a0ab-6c5efa087a3f}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="99"/>
<source>Dash value changed</source>
<extracomment>The name of the EventType ({0b602f14-1596-4091-a0ab-6c5efa087a3f}) of ThingClass currentPrices</extracomment>
<translation>Dash Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="102"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="105"/>
<source>Ethereum</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: eth, ID: {5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824})
----------
The name of the StateType ({5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="108"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="111"/>
<source>Ethereum Classic</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: etc, ID: {fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2})
----------
The name of the StateType ({fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="114"/>
<source>Ethereum value changed</source>
<extracomment>The name of the EventType ({5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824}) of ThingClass currentPrices</extracomment>
<translation>Etherium Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="117"/>
<source>Etherium Classic value changed</source>
<extracomment>The name of the EventType ({fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2}) of ThingClass currentPrices</extracomment>
<translation>Etherium Classic Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="120"/>
<source>Fiat Currency</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, Type: thing, ID: {92747d75-d18a-4915-bd48-0edd5cc5f19a})</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="123"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="126"/>
<source>IOTA</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: miota, ID: {2c6e341f-5940-40bb-b495-89c3ecaaf9e7})
----------
The name of the StateType ({2c6e341f-5940-40bb-b495-89c3ecaaf9e7}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="129"/>
<source>IOTA value changed</source>
<extracomment>The name of the EventType ({2c6e341f-5940-40bb-b495-89c3ecaaf9e7}) of ThingClass currentPrices</extracomment>
<translation>IOTA Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="132"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="135"/>
<source>Litecoin</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: ltc, ID: {f591f699-ae68-4f64-a221-254f836a31d3})
----------
The name of the StateType ({f591f699-ae68-4f64-a221-254f836a31d3}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="138"/>
<source>Litecoin value changed</source>
<extracomment>The name of the EventType ({f591f699-ae68-4f64-a221-254f836a31d3}) of ThingClass currentPrices</extracomment>
<translation>Litecoin Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="141"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="144"/>
<source>NEM</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: xem, ID: {adecda44-fade-4dba-8b41-cfb07579dea9})
----------
The name of the StateType ({adecda44-fade-4dba-8b41-cfb07579dea9}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="147"/>
<source>NEM value changed</source>
<extracomment>The name of the EventType ({adecda44-fade-4dba-8b41-cfb07579dea9}) of ThingClass currentPrices</extracomment>
<translation>NEM Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="150"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="153"/>
<source>NEO</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: ans, ID: {7583c720-1786-4c32-9552-e731578ff113})
----------
The name of the StateType ({7583c720-1786-4c32-9552-e731578ff113}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="156"/>
<source>NEO value changed</source>
<extracomment>The name of the EventType ({7583c720-1786-4c32-9552-e731578ff113}) of ThingClass currentPrices</extracomment>
<translation>NEO Wert geändert</translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="159"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="162"/>
<source>XRP</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: xrp, ID: {d8517cf8-2ebd-4be3-8573-00b595cc2ab5})
----------
The name of the StateType ({d8517cf8-2ebd-4be3-8573-00b595cc2ab5}) of ThingClass currentPrices</extracomment>
<translation></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="165"/>
<source>XRP value changed</source>
<extracomment>The name of the EventType ({d8517cf8-2ebd-4be3-8573-00b595cc2ab5}) of ThingClass currentPrices</extracomment>
<translation>XRP Wert geändert</translation>
</message>
</context>
</TS>

View File

@ -1,6 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>IntegrationPluginCoinMarketCap</name>
<message>
<location filename="../integrationplugincoinmarketcap.cpp" line="50"/>
<source>CoinMarketCap server is not reachable.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../integrationplugincoinmarketcap.cpp" line="52"/>
<source>Please enter your API token.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../integrationplugincoinmarketcap.cpp" line="74"/>
<source>This token is not valid.</source>
<extracomment>Error setting up device with invalid token</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>coinMarketCap</name>
<message>
@ -23,19 +42,28 @@ The name of the StateType ({cc5b4fe5-aa43-43b3-952f-90c0e3e20740}) of ThingClass
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="69"/>
<source>Coin Market Cap</source>
<extracomment>The name of the vendor ({28eeecbd-4178-45aa-81a6-fd95851444fd})</extracomment>
<source>Bitcoin Cash value changed</source>
<extracomment>The name of the EventType ({cc5b4fe5-aa43-43b3-952f-90c0e3e20740}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="72"/>
<source>Coin market cap</source>
<extracomment>The name of the plugin coinMarketCap ({532757cf-fc6f-4ce5-ae5b-e6f5bdb67fb4})</extracomment>
<source>Bitcoin value changed</source>
<extracomment>The name of the EventType ({721c91c8-8eb1-402e-8bfc-8e2d496be032}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="75"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="78"/>
<source>CoinMarketCap</source>
<extracomment>The name of the vendor ({28eeecbd-4178-45aa-81a6-fd95851444fd})
----------
The name of the plugin coinMarketCap ({532757cf-fc6f-4ce5-ae5b-e6f5bdb67fb4})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="81"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="84"/>
<source>Connected</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: connected, ID: {19f079f0-1654-44c3-ab10-e7d7f9742e09})
----------
@ -43,20 +71,20 @@ The name of the StateType ({19f079f0-1654-44c3-ab10-e7d7f9742e09}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="81"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="87"/>
<source>Connection status changed</source>
<extracomment>The name of the EventType ({19f079f0-1654-44c3-ab10-e7d7f9742e09}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="84"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="90"/>
<source>Crypto Prices</source>
<extracomment>The name of the ThingClass ({f5b794f7-7e2a-4409-8445-23ead80f2a8f})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="87"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="90"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="93"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="96"/>
<source>Dash</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: dash, ID: {0b602f14-1596-4091-a0ab-6c5efa087a3f})
----------
@ -64,14 +92,14 @@ The name of the StateType ({0b602f14-1596-4091-a0ab-6c5efa087a3f}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="93"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="99"/>
<source>Dash value changed</source>
<extracomment>The name of the EventType ({0b602f14-1596-4091-a0ab-6c5efa087a3f}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="96"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="99"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="102"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="105"/>
<source>Ethereum</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: eth, ID: {5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824})
----------
@ -79,8 +107,8 @@ The name of the StateType ({5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="102"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="105"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="108"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="111"/>
<source>Ethereum Classic</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: etc, ID: {fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2})
----------
@ -88,14 +116,26 @@ The name of the StateType ({fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="108"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="114"/>
<source>Ethereum value changed</source>
<extracomment>The name of the EventType ({5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="117"/>
<source>Etherium Classic value changed</source>
<extracomment>The name of the EventType ({fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="120"/>
<source>Fiat Currency</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, Type: thing, ID: {92747d75-d18a-4915-bd48-0edd5cc5f19a})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="111"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="114"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="123"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="126"/>
<source>IOTA</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: miota, ID: {2c6e341f-5940-40bb-b495-89c3ecaaf9e7})
----------
@ -103,14 +143,14 @@ The name of the StateType ({2c6e341f-5940-40bb-b495-89c3ecaaf9e7}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="117"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="129"/>
<source>IOTA value changed</source>
<extracomment>The name of the EventType ({2c6e341f-5940-40bb-b495-89c3ecaaf9e7}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="120"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="123"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="132"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="135"/>
<source>Litecoin</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: ltc, ID: {f591f699-ae68-4f64-a221-254f836a31d3})
----------
@ -118,14 +158,14 @@ The name of the StateType ({f591f699-ae68-4f64-a221-254f836a31d3}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="126"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="138"/>
<source>Litecoin value changed</source>
<extracomment>The name of the EventType ({f591f699-ae68-4f64-a221-254f836a31d3}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="129"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="132"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="141"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="144"/>
<source>NEM</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: xem, ID: {adecda44-fade-4dba-8b41-cfb07579dea9})
----------
@ -133,14 +173,14 @@ The name of the StateType ({adecda44-fade-4dba-8b41-cfb07579dea9}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="135"/>
<source>NEM cash value changed</source>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="147"/>
<source>NEM value changed</source>
<extracomment>The name of the EventType ({adecda44-fade-4dba-8b41-cfb07579dea9}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="138"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="141"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="150"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="153"/>
<source>NEO</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: ans, ID: {7583c720-1786-4c32-9552-e731578ff113})
----------
@ -148,47 +188,23 @@ The name of the StateType ({7583c720-1786-4c32-9552-e731578ff113}) of ThingClass
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="144"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="156"/>
<source>NEO value changed</source>
<extracomment>The name of the EventType ({7583c720-1786-4c32-9552-e731578ff113}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="147"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="150"/>
<source>Ripple</source>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="159"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="162"/>
<source>XRP</source>
<extracomment>The name of the ParamType (ThingClass: currentPrices, EventType: xrp, ID: {d8517cf8-2ebd-4be3-8573-00b595cc2ab5})
----------
The name of the StateType ({d8517cf8-2ebd-4be3-8573-00b595cc2ab5}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="153"/>
<source>bitcoin cash value changed</source>
<extracomment>The name of the EventType ({cc5b4fe5-aa43-43b3-952f-90c0e3e20740}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="156"/>
<source>bitcoin value changed</source>
<extracomment>The name of the EventType ({721c91c8-8eb1-402e-8bfc-8e2d496be032}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="159"/>
<source>ethereum value changed</source>
<extracomment>The name of the EventType ({5c58bb9f-dcdf-47c9-a0b7-f0ffc968f824}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="162"/>
<source>etherium classic value changed</source>
<extracomment>The name of the EventType ({fc9a61b7-c3df-4f13-ba31-d7743f3d2dc2}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/coinmarketcap/plugininfo.h" line="165"/>
<source>ripple value changed</source>
<source>XRP value changed</source>
<extracomment>The name of the EventType ({d8517cf8-2ebd-4be3-8573-00b595cc2ab5}) of ThingClass currentPrices</extracomment>
<translation type="unfinished"></translation>
</message>