From c7cdcaea0f6d90ef01235c2956fd60a51817cb30 Mon Sep 17 00:00:00 2001 From: Boernsman Date: Sat, 4 Jan 2020 18:58:23 +0100 Subject: [PATCH] removed debug output --- tado/deviceplugintado.json | 2 + tado/tado.cpp | 15 +- ...2d2ee-50bb-4786-b7f5-261fed204fa5-en_US.ts | 231 ++++++++++++++++++ 3 files changed, 238 insertions(+), 10 deletions(-) create mode 100644 tado/translations/b4f2d2ee-50bb-4786-b7f5-261fed204fa5-en_US.ts diff --git a/tado/deviceplugintado.json b/tado/deviceplugintado.json index 53c2de30..0814bd2c 100644 --- a/tado/deviceplugintado.json +++ b/tado/deviceplugintado.json @@ -139,6 +139,8 @@ "unit": "DegreeCelsius", "type": "double", "defaultValue": 0, + "minValue": 5, + "maxValue": 25, "writable": true }, { diff --git a/tado/tado.cpp b/tado/tado.cpp index 80e60608..0c88ddb1 100644 --- a/tado/tado.cpp +++ b/tado/tado.cpp @@ -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(); diff --git a/tado/translations/b4f2d2ee-50bb-4786-b7f5-261fed204fa5-en_US.ts b/tado/translations/b4f2d2ee-50bb-4786-b7f5-261fed204fa5-en_US.ts new file mode 100644 index 00000000..990760b5 --- /dev/null +++ b/tado/translations/b4f2d2ee-50bb-4786-b7f5-261fed204fa5-en_US.ts @@ -0,0 +1,231 @@ + + + + + DevicePluginTado + + + Please enter the login credentials. + + + + + Tado + + + + + + Available + 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 + + + + + + Available changed + 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 + + + + + Home id + The name of the ParamType (DeviceClass: zone, Type: device, ID: {330cad74-6f07-42ad-b226-299927c3c4f0}) + + + + + + Humidity + 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 + + + + + Humidity changed + The name of the EventType ({0faaaff1-2a33-44ec-b68d-d8855f584b02}) of DeviceClass zone + + + + + + Logged in + 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 + + + + + Logged in changed + The name of the EventType ({2aed240b-8c5c-418b-a9d1-0d75412c1c27}) of DeviceClass tadoConnection + + + + + + + Mode + 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 + + + + + Mode changed + The name of the EventType ({4cecf87c-8a5d-4bc4-a4ba-d2ee6103714b}) of DeviceClass zone + + + + + + Power + 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 + + + + + Power changed + The name of the EventType ({e886377d-34b7-4908-ad0d-ed463fc6181d}) of DeviceClass zone + + + + + Set mode + The name of the ActionType ({4cecf87c-8a5d-4bc4-a4ba-d2ee6103714b}) of DeviceClass zone + + + + + Set target temperature + The name of the ActionType ({684fcc62-f12b-4669-988e-4b79f153b0f2}) of DeviceClass zone + + + + + + Tado + The name of the vendor ({23c8a19f-bd6a-4c90-bcc9-2f0c0d9292c5}) +---------- +The name of the plugin Tado ({b4f2d2ee-50bb-4786-b7f5-261fed204fa5}) + + + + + Tado Connection + The name of the DeviceClass ({69be7d15-5658-4442-872e-42abbd8bff81}) + + + + + + Tado mode + 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 + + + + + Tado mode changed + The name of the EventType ({8b800998-5c2d-4940-9d0e-036979cf49ca}) of DeviceClass zone + + + + + + + Target temperature + 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 + + + + + Target temperature changed + The name of the EventType ({684fcc62-f12b-4669-988e-4b79f153b0f2}) of DeviceClass zone + + + + + + Temperature + 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 + + + + + Temperature changed + The name of the EventType ({80098178-7d92-43dd-a216-23704cc0eaa2}) of DeviceClass zone + + + + + Type + The name of the ParamType (DeviceClass: zone, Type: device, ID: {8e86797e-5333-4428-9dba-9ed5ac243b44}) + + + + + + Username + 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 + + + + + Username changed + The name of the EventType ({33f55afc-a673-47a4-9fb0-75fdac6a66f4}) of DeviceClass tadoConnection + + + + + + Window open + 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 + + + + + Window open changed + The name of the EventType ({c7a04e26-bb22-406e-b117-262bdb8b9c0e}) of DeviceClass zone + + + + + Zone + The name of the DeviceClass ({1a7bb944-fb9c-490a-8a4c-794b27282292}) + + + + + Zone id + The name of the ParamType (DeviceClass: zone, Type: device, ID: {cd67476b-978d-4a22-a40e-50cbc941e09e}) + + + +