eq-3: Add Qt6 support
parent
6acf92f22a
commit
da1d815894
|
|
@ -1,24 +1,22 @@
|
||||||
include(../plugins.pri)
|
include(../plugins.pri)
|
||||||
|
|
||||||
QT += network bluetooth
|
QT *= network bluetooth
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(nymea_integrationplugineq-3)
|
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
integrationplugineq-3.cpp \
|
integrationplugineq-3.cpp \
|
||||||
maxcubediscovery.cpp \
|
maxcubediscovery.cpp \
|
||||||
maxcube.cpp \
|
maxcube.cpp \
|
||||||
maxdevice.cpp \
|
maxdevice.cpp \
|
||||||
room.cpp \
|
room.cpp \
|
||||||
wallthermostat.cpp \
|
wallthermostat.cpp \
|
||||||
radiatorthermostat.cpp \
|
radiatorthermostat.cpp \
|
||||||
eqivabluetooth.cpp
|
eqivabluetooth.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
integrationplugineq-3.h \
|
integrationplugineq-3.h \
|
||||||
maxcubediscovery.h \
|
maxcubediscovery.h \
|
||||||
maxcube.h \
|
maxcube.h \
|
||||||
maxdevice.h \
|
maxdevice.h \
|
||||||
room.h \
|
room.h \
|
||||||
wallthermostat.h \
|
wallthermostat.h \
|
||||||
radiatorthermostat.h \
|
radiatorthermostat.h \
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -166,7 +166,11 @@ bool EqivaBluetooth::locked() const
|
||||||
int EqivaBluetooth::setLocked(bool locked)
|
int EqivaBluetooth::setLocked(bool locked)
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QDataStream stream(&data, QDataStream::WriteOnly);
|
||||||
|
#else
|
||||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
#endif
|
||||||
stream << commandLock;
|
stream << commandLock;
|
||||||
stream << (locked ? valueOn : valueOff);
|
stream << (locked ? valueOn : valueOff);
|
||||||
return enqueue("SetLocked", data);
|
return enqueue("SetLocked", data);
|
||||||
|
|
@ -180,7 +184,11 @@ bool EqivaBluetooth::boostEnabled() const
|
||||||
int EqivaBluetooth::setBoostEnabled(bool enabled)
|
int EqivaBluetooth::setBoostEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QDataStream stream(&data, QDataStream::WriteOnly);
|
||||||
|
#else
|
||||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
#endif
|
||||||
stream << commandBoost;
|
stream << commandBoost;
|
||||||
stream << (enabled ? valueOn : valueOff);
|
stream << (enabled ? valueOn : valueOff);
|
||||||
return enqueue("SetBoostEnabled", data);
|
return enqueue("SetBoostEnabled", data);
|
||||||
|
|
@ -194,7 +202,11 @@ qreal EqivaBluetooth::targetTemperature() const
|
||||||
int EqivaBluetooth::setTargetTemperature(qreal targetTemperature)
|
int EqivaBluetooth::setTargetTemperature(qreal targetTemperature)
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QDataStream stream(&data, QDataStream::WriteOnly);
|
||||||
|
#else
|
||||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
#endif
|
||||||
stream << commandSetTemp;
|
stream << commandSetTemp;
|
||||||
if (targetTemperature == 4.5) {
|
if (targetTemperature == 4.5) {
|
||||||
stream << static_cast<quint8>(4.5 * 2); // 4.5 degrees is off
|
stream << static_cast<quint8>(4.5 * 2); // 4.5 degrees is off
|
||||||
|
|
@ -211,8 +223,12 @@ EqivaBluetooth::Mode EqivaBluetooth::mode() const
|
||||||
|
|
||||||
int EqivaBluetooth::setMode(EqivaBluetooth::Mode mode)
|
int EqivaBluetooth::setMode(EqivaBluetooth::Mode mode)
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QDataStream stream(&data, QDataStream::WriteOnly);
|
||||||
|
#else
|
||||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
#endif
|
||||||
stream << commandSetMode;
|
stream << commandSetMode;
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case ModeAuto:
|
case ModeAuto:
|
||||||
|
|
@ -259,7 +275,7 @@ void EqivaBluetooth::controllerStateChanged(const QLowEnergyController::Controll
|
||||||
|
|
||||||
if (state == QLowEnergyController::UnconnectedState) {
|
if (state == QLowEnergyController::UnconnectedState) {
|
||||||
int delay = qMin(m_reconnectAttempt, 30);
|
int delay = qMin(m_reconnectAttempt, 30);
|
||||||
qWarning(dcEQ3()) << m_name << "Eqiva thing disconnected. Reconnecting in" << delay << "sec";
|
qCWarning(dcEQ3()) << m_name << "Eqiva thing disconnected. Reconnecting in" << delay << "sec";
|
||||||
m_available = false;
|
m_available = false;
|
||||||
emit availableChanged();
|
emit availableChanged();
|
||||||
|
|
||||||
|
|
@ -312,7 +328,11 @@ void EqivaBluetooth::controllerStateChanged(const QLowEnergyController::Controll
|
||||||
qCDebug(dcEQ3()) << m_name << "Characteristic read:" << info.name() << info.uuid() << value.toHex();
|
qCDebug(dcEQ3()) << m_name << "Characteristic read:" << info.name() << info.uuid() << value.toHex();
|
||||||
|
|
||||||
QByteArray data(value);
|
QByteArray data(value);
|
||||||
QDataStream stream(&data, QIODevice::ReadOnly);
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QDataStream stream(&data, QDataStream::WriteOnly);
|
||||||
|
#else
|
||||||
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
#endif
|
||||||
quint8 header;
|
quint8 header;
|
||||||
stream >> header;
|
stream >> header;
|
||||||
quint8 notificationType;
|
quint8 notificationType;
|
||||||
|
|
@ -371,7 +391,11 @@ void EqivaBluetooth::serviceStateChanged(QLowEnergyService::ServiceState newStat
|
||||||
|
|
||||||
// Enable notifications
|
// Enable notifications
|
||||||
QLowEnergyCharacteristic characteristic = m_eqivaService->characteristic(notificationCharacteristicUuid);
|
QLowEnergyCharacteristic characteristic = m_eqivaService->characteristic(notificationCharacteristicUuid);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QLowEnergyDescriptor notificationDescriptor = characteristic.descriptor(QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration);
|
||||||
|
#else
|
||||||
QLowEnergyDescriptor notificationDescriptor = characteristic.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration);
|
QLowEnergyDescriptor notificationDescriptor = characteristic.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration);
|
||||||
|
#endif
|
||||||
m_eqivaService->writeDescriptor(notificationDescriptor, QByteArray::fromHex("0100"));
|
m_eqivaService->writeDescriptor(notificationDescriptor, QByteArray::fromHex("0100"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -384,7 +408,11 @@ void EqivaBluetooth::characteristicChanged(const QLowEnergyCharacteristic &info,
|
||||||
m_refreshTimer.start();
|
m_refreshTimer.start();
|
||||||
|
|
||||||
QByteArray data(value);
|
QByteArray data(value);
|
||||||
QDataStream stream(&data, QIODevice::ReadOnly);
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QDataStream stream(&data, QDataStream::WriteOnly);
|
||||||
|
#else
|
||||||
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
#endif
|
||||||
quint8 header;
|
quint8 header;
|
||||||
stream >> header;
|
stream >> header;
|
||||||
if (header == notifyHeader) {
|
if (header == notifyHeader) {
|
||||||
|
|
@ -470,7 +498,11 @@ void EqivaBluetooth::sendDate()
|
||||||
QDateTime now = QDateTime::currentDateTime();
|
QDateTime now = QDateTime::currentDateTime();
|
||||||
|
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QDataStream stream(&data, QDataStream::WriteOnly);
|
||||||
|
#else
|
||||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||||
|
#endif
|
||||||
stream << commandSetDate;
|
stream << commandSetDate;
|
||||||
stream << static_cast<quint8>(now.date().year() - 2000);
|
stream << static_cast<quint8>(now.date().year() - 2000);
|
||||||
stream << static_cast<quint8>(now.date().month());
|
stream << static_cast<quint8>(now.date().month());
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "hardware/bluetoothlowenergy/bluetoothlowenergymanager.h"
|
#include <hardware/bluetoothlowenergy/bluetoothlowenergymanager.h>
|
||||||
|
|
||||||
|
|
||||||
class EqivaBluetooth : public QObject
|
class EqivaBluetooth : public QObject
|
||||||
|
|
@ -145,7 +145,7 @@ private slots:
|
||||||
void deviceDiscoveryDone();
|
void deviceDiscoveryDone();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void finished(const QList<DiscoveryResult> &results);
|
void finished(const QList<EqivaBluetoothDiscovery::DiscoveryResult> &results);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BluetoothLowEnergyManager *m_bluetoothManager = nullptr;
|
BluetoothLowEnergyManager *m_bluetoothManager = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -29,12 +29,14 @@
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
#include "integrationplugineq-3.h"
|
#include "integrationplugineq-3.h"
|
||||||
|
#include "maxcubediscovery.h"
|
||||||
#include "integrations/thing.h"
|
|
||||||
#include "types/param.h"
|
|
||||||
#include "plugininfo.h"
|
|
||||||
|
|
||||||
#include "eqivabluetooth.h"
|
#include "eqivabluetooth.h"
|
||||||
|
#include "plugininfo.h"
|
||||||
|
#include "maxcube.h"
|
||||||
|
|
||||||
|
#include <integrations/thing.h>
|
||||||
|
#include <types/param.h>
|
||||||
|
#include <hardwaremanager.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
@ -169,7 +171,9 @@ void IntegrationPluginEQ3::setupThing(ThingSetupInfo *info)
|
||||||
qCDebug(dcEQ3) << "Setup thing" << thing->params();
|
qCDebug(dcEQ3) << "Setup thing" << thing->params();
|
||||||
|
|
||||||
if(thing->thingClassId() == cubeThingClassId){
|
if(thing->thingClassId() == cubeThingClassId){
|
||||||
MaxCube *cube = new MaxCube(this,thing->paramValue(cubeThingSerialParamTypeId).toString(),QHostAddress(thing->paramValue(cubeThingHostParamTypeId).toString()),thing->paramValue(cubeThingPortParamTypeId).toInt());
|
MaxCube *cube = new MaxCube(this, thing->paramValue(cubeThingSerialParamTypeId).toString(),
|
||||||
|
QHostAddress(thing->paramValue(cubeThingHostParamTypeId).toString()),
|
||||||
|
thing->paramValue(cubeThingPortParamTypeId).toInt());
|
||||||
m_cubes.insert(cube,thing);
|
m_cubes.insert(cube,thing);
|
||||||
|
|
||||||
connect(cube, &MaxCube::cubeConnectionStatusChanged, this, &IntegrationPluginEQ3::cubeConnectionStatusChanged);
|
connect(cube, &MaxCube::cubeConnectionStatusChanged, this, &IntegrationPluginEQ3::cubeConnectionStatusChanged);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -31,13 +31,14 @@
|
||||||
#ifndef INTEGRATIONPLUGINEQ3_H
|
#ifndef INTEGRATIONPLUGINEQ3_H
|
||||||
#define INTEGRATIONPLUGINEQ3_H
|
#define INTEGRATIONPLUGINEQ3_H
|
||||||
|
|
||||||
#include "integrations/integrationplugin.h"
|
#include <integrations/integrationplugin.h>
|
||||||
#include "maxcubediscovery.h"
|
#include <plugintimer.h>
|
||||||
#include "plugintimer.h"
|
|
||||||
#include "eqivabluetooth.h"
|
|
||||||
|
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
|
|
||||||
|
#include "eqivabluetooth.h"
|
||||||
|
|
||||||
|
class MaxCube;
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
|
|
||||||
class IntegrationPluginEQ3: public IntegrationPlugin
|
class IntegrationPluginEQ3: public IntegrationPlugin
|
||||||
|
|
@ -70,7 +71,7 @@ private:
|
||||||
QList<Param> m_config;
|
QList<Param> m_config;
|
||||||
QHash<MaxCube *, Thing *> m_cubes;
|
QHash<MaxCube *, Thing *> m_cubes;
|
||||||
|
|
||||||
QHash<Thing*, EqivaBluetooth*> m_eqivaDevices;
|
QHash<Thing *, EqivaBluetooth *> m_eqivaDevices;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onPluginTimer();
|
void onPluginTimer();
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,15 @@ MaxCube::MaxCube(QObject *parent, QString serialNumber, QHostAddress hostAdress,
|
||||||
|
|
||||||
m_cubeInitialized = false;
|
m_cubeInitialized = false;
|
||||||
|
|
||||||
connect(this,SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(connectionStateChanged(QAbstractSocket::SocketState)));
|
connect(this, &MaxCube::stateChanged, this, &MaxCube::connectionStateChanged);
|
||||||
|
connect(this, &MaxCube::readyRead, this, &MaxCube::onReadyRead);
|
||||||
|
connect(this, &MaxCube::cubeDataAvailable, this, &MaxCube::processCubeData);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||||
|
connect(this, &MaxCube::errorOccurred, this, &MaxCube::onTcpError);
|
||||||
|
#else
|
||||||
|
connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onTcpError(QAbstractSocket::SocketError)));
|
||||||
|
#endif
|
||||||
|
|
||||||
connect(this,SIGNAL(readyRead()),this,SLOT(onReadyRead()));
|
|
||||||
connect(this,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(error(QAbstractSocket::SocketError)));
|
|
||||||
|
|
||||||
connect(this,SIGNAL(cubeDataAvailable(QByteArray)),this,SLOT(processCubeData(QByteArray)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaxCube::serialNumber() const
|
QString MaxCube::serialNumber() const
|
||||||
|
|
@ -698,7 +701,7 @@ quint8 MaxCube::generateCommandId()
|
||||||
return cmd++;
|
return cmd++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaxCube::connectionStateChanged(const QAbstractSocket::SocketState &socketState)
|
void MaxCube::connectionStateChanged(QAbstractSocket::SocketState socketState)
|
||||||
{
|
{
|
||||||
switch (socketState) {
|
switch (socketState) {
|
||||||
case QAbstractSocket::ConnectedState:
|
case QAbstractSocket::ConnectedState:
|
||||||
|
|
@ -715,7 +718,7 @@ void MaxCube::connectionStateChanged(const QAbstractSocket::SocketState &socketS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaxCube::error(QAbstractSocket::SocketError error)
|
void MaxCube::onTcpError(QAbstractSocket::SocketError error)
|
||||||
{
|
{
|
||||||
qCWarning(dcEQ3) << "connection error (" << m_serialNumber << "): " << error;
|
qCWarning(dcEQ3) << "connection error (" << m_serialNumber << "): " << error;
|
||||||
emit cubeConnectionStatusChanged(false);
|
emit cubeConnectionStatusChanged(false);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -36,11 +36,11 @@
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
|
|
||||||
#include "maxdevice.h"
|
#include <integrations/integrationplugin.h>
|
||||||
|
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "wallthermostat.h"
|
#include "wallthermostat.h"
|
||||||
#include "radiatorthermostat.h"
|
#include "radiatorthermostat.h"
|
||||||
#include "integrations/integrationplugin.h"
|
|
||||||
|
|
||||||
class MaxCube : public QTcpSocket
|
class MaxCube : public QTcpSocket
|
||||||
{
|
{
|
||||||
|
|
@ -79,8 +79,8 @@ public:
|
||||||
|
|
||||||
bool portalEnabeld() const;
|
bool portalEnabeld() const;
|
||||||
|
|
||||||
QList<WallThermostat*> wallThermostatList();
|
QList<WallThermostat *> wallThermostatList();
|
||||||
QList<RadiatorThermostat*> radiatorThermostatList();
|
QList<RadiatorThermostat *> radiatorThermostatList();
|
||||||
|
|
||||||
QList<Room*> roomList();
|
QList<Room*> roomList();
|
||||||
|
|
||||||
|
|
@ -120,8 +120,8 @@ signals:
|
||||||
void commandActionFinished(bool succeeded, int commandId);
|
void commandActionFinished(bool succeeded, int commandId);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void connectionStateChanged(const QAbstractSocket::SocketState &socketState);
|
void connectionStateChanged(SocketState socketState);
|
||||||
void error(QAbstractSocket::SocketError error);
|
void onTcpError(QAbstractSocket::SocketError error);
|
||||||
void onReadyRead();
|
void onReadyRead();
|
||||||
void processCubeData(const QByteArray &data);
|
void processCubeData(const QByteArray &data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ MaxCubeDiscovery::MaxCubeDiscovery(QObject *parent) :
|
||||||
m_timeout = new QTimer(this);
|
m_timeout = new QTimer(this);
|
||||||
m_timeout->setSingleShot(true);
|
m_timeout->setSingleShot(true);
|
||||||
|
|
||||||
connect(m_udpSocket,SIGNAL(readyRead()),this,SLOT(readData()));
|
connect(m_udpSocket, &QUdpSocket::readyRead, this, &MaxCubeDiscovery::readData);
|
||||||
connect(m_timeout,SIGNAL(timeout()),this,SLOT(discoverTimeout()));
|
connect(m_timeout, &QTimer::timeout, this, &MaxCubeDiscovery::discoverTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaxCubeDiscovery::detectCubes()
|
void MaxCubeDiscovery::detectCubes()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -36,8 +36,6 @@
|
||||||
#include <QHostAddress>
|
#include <QHostAddress>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include "maxcube.h"
|
|
||||||
|
|
||||||
class MaxCubeDiscovery : public QObject
|
class MaxCubeDiscovery : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -60,11 +58,11 @@ private slots:
|
||||||
void discoverTimeout();
|
void discoverTimeout();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void cubesDetected(const QList<CubeInfo> &cubeList);
|
void cubesDetected(const QList<MaxCubeDiscovery::CubeInfo> &cubeList);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QUdpSocket *m_udpSocket;
|
QUdpSocket *m_udpSocket = nullptr;
|
||||||
QTimer *m_timeout;
|
QTimer *m_timeout = nullptr;
|
||||||
|
|
||||||
quint16 m_port;
|
quint16 m_port;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -33,8 +33,6 @@
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
#include "room.h"
|
|
||||||
|
|
||||||
class MaxDevice : public QObject
|
class MaxDevice : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -87,10 +85,6 @@ private:
|
||||||
QString m_roomName;
|
QString m_roomName;
|
||||||
bool m_batteryOk;
|
bool m_batteryOk;
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAXDEVICE_H
|
#endif // MAXDEVICE_H
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2025, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -147,10 +147,6 @@ private:
|
||||||
int m_valvePosition;
|
int m_valvePosition;
|
||||||
double m_setpointTemperature;
|
double m_setpointTemperature;
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RADIATORTHERMOSTAT_H
|
#endif // RADIATORTHERMOSTAT_H
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,6 @@ private:
|
||||||
QString m_roomName;
|
QString m_roomName;
|
||||||
QByteArray m_groupRfAddress;
|
QByteArray m_groupRfAddress;
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ROOM_H
|
#endif // ROOM_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue