removed debug output

master
Boernsman 2020-01-04 18:58:23 +01:00
parent 5c28eaf871
commit c7cdcaea0f
3 changed files with 238 additions and 10 deletions

View File

@ -139,6 +139,8 @@
"unit": "DegreeCelsius",
"type": "double",
"defaultValue": 0,
"minValue": 5,
"maxValue": 25,
"writable": true
},
{

View File

@ -68,7 +68,7 @@ void Tado::getToken(const QString &password)
body.append("&password=" + password);
QNetworkReply *reply = m_networkManager->post(request, body);
qCDebug(dcTado()) << "Sending request" << request.url() << body;
//qCDebug(dcTado()) << "Sending request" << request.url() << body;
connect(reply, &QNetworkReply::finished, this, [reply, this] {
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -129,7 +129,7 @@ void Tado::getHomes()
request.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/x-www-form-urlencoded");
request.setRawHeader("Authorization", "Bearer " + m_accessToken.toLocal8Bit());
QNetworkReply *reply = m_networkManager->get(request);
qDebug(dcTado()) << "Sending request" << request.url() << request.rawHeaderList();
//qDebug(dcTado()) << "Sending request" << request.url() << request.rawHeaderList();
connect(reply, &QNetworkReply::finished, this, [reply, this] {
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -161,7 +161,6 @@ void Tado::getHomes()
Home home;
home.id = obj["id"].toString();
home.name = obj["name"].toString();
homes.append(home);
}
emit homesReceived(homes);
@ -175,7 +174,7 @@ void Tado::getZones(const QString &homeId)
request.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/x-www-form-urlencoded");
request.setRawHeader("Authorization", "Bearer " + m_accessToken.toLocal8Bit());
QNetworkReply *reply = m_networkManager->get(request);
qDebug(dcTado()) << "Sending request" << request.url() << request.rawHeaderList();
//qDebug(dcTado()) << "Sending request" << request.url() << request.rawHeaderList();
connect(reply, &QNetworkReply::finished, this, [reply, homeId, this] {
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -221,7 +220,7 @@ void Tado::getZoneState(const QString &homeId, const QString &zoneId)
request.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/x-www-form-urlencoded");
request.setRawHeader("Authorization", "Bearer " + m_accessToken.toLocal8Bit());
QNetworkReply *reply = m_networkManager->get(request);
qDebug(dcTado()) << "Sending request" << request.url() << request.rawHeaderList();
//qDebug(dcTado()) << "Sending request" << request.url() << request.rawHeaderList();
connect(reply, &QNetworkReply::finished, this, [reply, homeId, zoneId, this] {
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -247,8 +246,6 @@ void Tado::getZoneState(const QString &homeId, const QString &zoneId)
qDebug(dcTado()) << "Get Token: Recieved invalide JSON object";
return;
}
qDebug(dcTado()) << "Get zone stat" << data;
ZoneState state;
QVariantMap map = data.toVariant().toMap();
state.tadoMode = map["tadoMode"].toString();
@ -258,7 +255,6 @@ void Tado::getZoneState(const QString &homeId, const QString &zoneId)
state.settingType = settingsMap["type"].toString();
state.settingPower = (settingsMap["power"].toString() == "ON");
state.settingTemperature = settingsMap["temperature"].toMap().value("celsius").toDouble();
state.connected = (map["link"].toMap().value("state").toString() == "ONLINE");
QVariantMap activityDataMap = map["activityDataPoints"].toMap();
@ -273,7 +269,6 @@ void Tado::getZoneState(const QString &homeId, const QString &zoneId)
state.overlayIsSet = true;
QVariantMap overlayMap = map["overlay"].toMap();
state.overlayType = map["overlayType"].toString();
qCDebug(dcTado()) << "Overlay power" << overlayMap["setting"].toMap().value("power").toString() << overlayMap["setting"].toMap().value("temperature").toDouble();
state.overlaySettingPower = (overlayMap["setting"].toMap().value("power").toString() == "ON");
state.overlaySettingTemperature = overlayMap["setting"].toMap().value("temperature").toDouble();
} else {
@ -299,7 +294,7 @@ QUuid Tado::setOverlay(const QString &homeId, const QString &zoneId, bool power,
powerString = "OFF";
body.append("{\"setting\":{\"type\":\"HEATING\",\"power\":\""+ powerString + "\",\"temperature\":{\"celsius\":" + QVariant(targetTemperature).toByteArray() + "}},\"termination\":{\"type\":\"MANUAL\"}}");
qCDebug(dcTado()) << "Sending request" << body;
//qCDebug(dcTado()) << "Sending request" << body;
QNetworkReply *reply = m_networkManager->put(request, body);
connect(reply, &QNetworkReply::finished, this, [homeId, zoneId, requestId, reply, this] {
reply->deleteLater();

View File

@ -0,0 +1,231 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>DevicePluginTado</name>
<message>
<location filename="../deviceplugintado.cpp" line="45"/>
<source>Please enter the login credentials.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Tado</name>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="64"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="67"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="70"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="73"/>
<source>Available</source>
<extracomment>The name of the ParamType (DeviceClass: zone, EventType: connected, ID: {9f45a703-6a15-447c-a77a-0df731cda48e})
----------
The name of the StateType ({9f45a703-6a15-447c-a77a-0df731cda48e}) of DeviceClass zone
----------
The name of the ParamType (DeviceClass: tadoConnection, EventType: connected, ID: {2f79bc1d-27ed-480a-b583-728363c83ea6})
----------
The name of the StateType ({2f79bc1d-27ed-480a-b583-728363c83ea6}) of DeviceClass tadoConnection</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="76"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="79"/>
<source>Available changed</source>
<extracomment>The name of the EventType ({9f45a703-6a15-447c-a77a-0df731cda48e}) of DeviceClass zone
----------
The name of the EventType ({2f79bc1d-27ed-480a-b583-728363c83ea6}) of DeviceClass tadoConnection</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="82"/>
<source>Home id</source>
<extracomment>The name of the ParamType (DeviceClass: zone, Type: device, ID: {330cad74-6f07-42ad-b226-299927c3c4f0})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="85"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="88"/>
<source>Humidity</source>
<extracomment>The name of the ParamType (DeviceClass: zone, EventType: humidity, ID: {0faaaff1-2a33-44ec-b68d-d8855f584b02})
----------
The name of the StateType ({0faaaff1-2a33-44ec-b68d-d8855f584b02}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="91"/>
<source>Humidity changed</source>
<extracomment>The name of the EventType ({0faaaff1-2a33-44ec-b68d-d8855f584b02}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="94"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="97"/>
<source>Logged in</source>
<extracomment>The name of the ParamType (DeviceClass: tadoConnection, EventType: loggedIn, ID: {2aed240b-8c5c-418b-a9d1-0d75412c1c27})
----------
The name of the StateType ({2aed240b-8c5c-418b-a9d1-0d75412c1c27}) of DeviceClass tadoConnection</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="100"/>
<source>Logged in changed</source>
<extracomment>The name of the EventType ({2aed240b-8c5c-418b-a9d1-0d75412c1c27}) of DeviceClass tadoConnection</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="103"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="106"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="109"/>
<source>Mode</source>
<extracomment>The name of the ParamType (DeviceClass: zone, ActionType: mode, ID: {4cecf87c-8a5d-4bc4-a4ba-d2ee6103714b})
----------
The name of the ParamType (DeviceClass: zone, EventType: mode, ID: {4cecf87c-8a5d-4bc4-a4ba-d2ee6103714b})
----------
The name of the StateType ({4cecf87c-8a5d-4bc4-a4ba-d2ee6103714b}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="112"/>
<source>Mode changed</source>
<extracomment>The name of the EventType ({4cecf87c-8a5d-4bc4-a4ba-d2ee6103714b}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="115"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="118"/>
<source>Power</source>
<extracomment>The name of the ParamType (DeviceClass: zone, EventType: power, ID: {e886377d-34b7-4908-ad0d-ed463fc6181d})
----------
The name of the StateType ({e886377d-34b7-4908-ad0d-ed463fc6181d}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="121"/>
<source>Power changed</source>
<extracomment>The name of the EventType ({e886377d-34b7-4908-ad0d-ed463fc6181d}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="124"/>
<source>Set mode</source>
<extracomment>The name of the ActionType ({4cecf87c-8a5d-4bc4-a4ba-d2ee6103714b}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="127"/>
<source>Set target temperature</source>
<extracomment>The name of the ActionType ({684fcc62-f12b-4669-988e-4b79f153b0f2}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="130"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="133"/>
<source>Tado</source>
<extracomment>The name of the vendor ({23c8a19f-bd6a-4c90-bcc9-2f0c0d9292c5})
----------
The name of the plugin Tado ({b4f2d2ee-50bb-4786-b7f5-261fed204fa5})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="136"/>
<source>Tado Connection</source>
<extracomment>The name of the DeviceClass ({69be7d15-5658-4442-872e-42abbd8bff81})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="139"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="142"/>
<source>Tado mode</source>
<extracomment>The name of the ParamType (DeviceClass: zone, EventType: tadoMode, ID: {8b800998-5c2d-4940-9d0e-036979cf49ca})
----------
The name of the StateType ({8b800998-5c2d-4940-9d0e-036979cf49ca}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="145"/>
<source>Tado mode changed</source>
<extracomment>The name of the EventType ({8b800998-5c2d-4940-9d0e-036979cf49ca}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="148"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="151"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="154"/>
<source>Target temperature</source>
<extracomment>The name of the ParamType (DeviceClass: zone, ActionType: targetTemperature, ID: {684fcc62-f12b-4669-988e-4b79f153b0f2})
----------
The name of the ParamType (DeviceClass: zone, EventType: targetTemperature, ID: {684fcc62-f12b-4669-988e-4b79f153b0f2})
----------
The name of the StateType ({684fcc62-f12b-4669-988e-4b79f153b0f2}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="157"/>
<source>Target temperature changed</source>
<extracomment>The name of the EventType ({684fcc62-f12b-4669-988e-4b79f153b0f2}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="160"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="163"/>
<source>Temperature</source>
<extracomment>The name of the ParamType (DeviceClass: zone, EventType: temperature, ID: {80098178-7d92-43dd-a216-23704cc0eaa2})
----------
The name of the StateType ({80098178-7d92-43dd-a216-23704cc0eaa2}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="166"/>
<source>Temperature changed</source>
<extracomment>The name of the EventType ({80098178-7d92-43dd-a216-23704cc0eaa2}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="169"/>
<source>Type</source>
<extracomment>The name of the ParamType (DeviceClass: zone, Type: device, ID: {8e86797e-5333-4428-9dba-9ed5ac243b44})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="172"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="175"/>
<source>Username</source>
<extracomment>The name of the ParamType (DeviceClass: tadoConnection, EventType: userDisplayName, ID: {33f55afc-a673-47a4-9fb0-75fdac6a66f4})
----------
The name of the StateType ({33f55afc-a673-47a4-9fb0-75fdac6a66f4}) of DeviceClass tadoConnection</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="178"/>
<source>Username changed</source>
<extracomment>The name of the EventType ({33f55afc-a673-47a4-9fb0-75fdac6a66f4}) of DeviceClass tadoConnection</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="181"/>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="184"/>
<source>Window open</source>
<extracomment>The name of the ParamType (DeviceClass: zone, EventType: windowOpen, ID: {c7a04e26-bb22-406e-b117-262bdb8b9c0e})
----------
The name of the StateType ({c7a04e26-bb22-406e-b117-262bdb8b9c0e}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="187"/>
<source>Window open changed</source>
<extracomment>The name of the EventType ({c7a04e26-bb22-406e-b117-262bdb8b9c0e}) of DeviceClass zone</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="190"/>
<source>Zone</source>
<extracomment>The name of the DeviceClass ({1a7bb944-fb9c-490a-8a4c-794b27282292})</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../../build-nymea-plugins-Desktop-Debug/tado/plugininfo.h" line="193"/>
<source>Zone id</source>
<extracomment>The name of the ParamType (DeviceClass: zone, Type: device, ID: {cd67476b-978d-4a22-a40e-50cbc941e09e})</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
</TS>