EQ-3, Tado: Update thermostats windowOpenDetected states

The interface now distinguishes between states that are
informative (read only) and ones that can be set.
master
Michael Zanetti 2023-03-16 17:09:25 +01:00
parent 4acddd2219
commit 3744ce040b
5 changed files with 13 additions and 12 deletions

View File

@ -66,7 +66,7 @@ void IntegrationPluginEQ3::discoverThings(ThingDiscoveryInfo *info)
connect(info, &QObject::destroyed, cubeDiscovery, &MaxCubeDiscovery::deleteLater);
connect(cubeDiscovery, &MaxCubeDiscovery::cubesDetected, info, [this, info, cubeDiscovery](const QList<MaxCubeDiscovery::CubeInfo> &cubeList){
connect(cubeDiscovery, &MaxCubeDiscovery::cubesDetected, info, [this, info](const QList<MaxCubeDiscovery::CubeInfo> &cubeList){
foreach (const MaxCubeDiscovery::CubeInfo &cube, cubeList) {
ThingDescriptor descriptor(cubeThingClassId, "Max! Cube LAN Gateway", cube.serialNumber);
@ -200,9 +200,9 @@ void IntegrationPluginEQ3::setupThing(ThingSetupInfo *info)
thing->setStateValue(eqivaBluetoothTargetTemperatureStateTypeId, eqivaDevice->targetTemperature());
});
// Window open state
thing->setStateValue(eqivaBluetoothWindowOpenStateTypeId, eqivaDevice->windowOpen());
thing->setStateValue(eqivaBluetoothWindowOpenDetectedStateTypeId, eqivaDevice->windowOpen());
connect(eqivaDevice, &EqivaBluetooth::windowOpenChanged, thing, [thing, eqivaDevice](){
thing->setStateValue(eqivaBluetoothWindowOpenStateTypeId, eqivaDevice->windowOpen());
thing->setStateValue(eqivaBluetoothWindowOpenDetectedStateTypeId, eqivaDevice->windowOpen());
});
// Valve open state
thing->setStateValue(eqivaBluetoothValveOpenStateTypeId, eqivaDevice->valveOpen());

View File

@ -611,9 +611,8 @@
},
{
"id": "dcacdacc-ee47-43b0-9fef-1fe423e4f355",
"name": "windowOpen",
"name": "windowOpenDetected",
"displayName": "Window open detected",
"displayNameEvent": "Window open changed",
"type": "bool",
"defaultValue": false
},

View File

@ -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(zoneWindowOpenStateTypeId, state.windowOpen);
thing->setStateValue(zoneWindowOpenDetectedStateTypeId, state.windowOpen);
thing->setStateValue(zoneTadoModeStateTypeId, state.tadoMode);
}

View File

@ -31,12 +31,15 @@
#ifndef INTEGRATIONPLUGINTADO_H
#define INTEGRATIONPLUGINTADO_H
#include "plugintimer.h"
#include "integrations/integrationplugin.h"
#include "network/oauth2.h"
#include "tado.h"
#include "extern-plugininfo.h"
#include <plugintimer.h>
#include <integrations/integrationplugin.h>
#include <network/oauth2.h>
#include <QHash>
#include <QTimer>
class IntegrationPluginTado : public IntegrationPlugin

View File

@ -117,9 +117,8 @@
},
{
"id": "c7a04e26-bb22-406e-b117-262bdb8b9c0e",
"name": "windowOpen",
"displayName": "Window open",
"displayNameEvent": "Window open changed",
"name": "windowOpenDetected",
"displayName": "Window open detected",
"type": "bool",
"defaultValue": false
},