From e3acb067b9d67a2c01e47ee949636855871baf01 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 20 Mar 2023 09:37:45 +0100 Subject: [PATCH] Fix tado windowOpenDetected state --- tado/integrationplugintado.cpp | 2 +- tado/tado.cpp | 4 +++- tado/tado.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tado/integrationplugintado.cpp b/tado/integrationplugintado.cpp index 550f8a2c..fd950f4c 100644 --- a/tado/integrationplugintado.cpp +++ b/tado/integrationplugintado.cpp @@ -432,7 +432,7 @@ void IntegrationPluginTado::onZoneStateReceived(const QString &homeId, const QSt thing->setStateValue(zoneTargetTemperatureStateTypeId, state.settingTemperature); thing->setStateValue(zoneTemperatureStateTypeId, state.temperature); thing->setStateValue(zoneHumidityStateTypeId, state.humidity); - thing->setStateValue(zoneWindowOpenDetectedStateTypeId, state.windowOpen); + thing->setStateValue(zoneWindowOpenDetectedStateTypeId, state.windowOpenDetected); thing->setStateValue(zoneTadoModeStateTypeId, state.tadoMode); } diff --git a/tado/tado.cpp b/tado/tado.cpp index 137f8774..7a96f81e 100644 --- a/tado/tado.cpp +++ b/tado/tado.cpp @@ -356,6 +356,7 @@ void Tado::getZoneState(const QString &homeId, const QString &zoneId) return; } + setConnectionStatus(true); setAuthenticationStatus(true); @@ -365,10 +366,11 @@ void Tado::getZoneState(const QString &homeId, const QString &zoneId) qDebug(dcTado()) << "Get Token: Recieved invalid JSON object"; return; } + qCDebug(dcTado()) << "Zone status received:" << qUtf8Printable(data.toJson(QJsonDocument::Indented)); ZoneState state; QVariantMap map = data.toVariant().toMap(); state.tadoMode = map["tadoMode"].toString(); - state.windowOpen = map["openWindow"].toBool(); + state.windowOpenDetected = map["openWindowDetected"].toBool(); QVariantMap settingsMap = map["setting"].toMap(); state.settingType = settingsMap["type"].toString(); diff --git a/tado/tado.h b/tado/tado.h index 8c9f9e02..e2d8303e 100644 --- a/tado/tado.h +++ b/tado/tado.h @@ -75,7 +75,7 @@ public: bool settingPower = false; double temperature = false; double humidity = false; - bool windowOpen = false; + bool windowOpenDetected = false; double heatingPowerPercentage = false; QString heatingPowerType; bool overlayIsSet = false;