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;