garadget: Add Qt6 support

This commit is contained in:
Simon Stürz 2025-08-08 13:35:26 +02:00
parent d46177e1eb
commit d49f9ddbdf
2 changed files with 11 additions and 10 deletions

View File

@ -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,14 +29,15 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "integrationplugingaradget.h" #include "integrationplugingaradget.h"
#include "integrations/thing.h"
#include "plugininfo.h" #include "plugininfo.h"
#include <QJsonDocument> #include <integrations/thing.h>
#include <network/networkaccessmanager.h>
#include "network/mqtt/mqttprovider.h" #include <network/mqtt/mqttprovider.h>
#include <mqttclient.h> #include <mqttclient.h>
#include <QJsonDocument>
void IntegrationPluginGaradget::setupThing(ThingSetupInfo *info) void IntegrationPluginGaradget::setupThing(ThingSetupInfo *info)
{ {
@ -63,7 +64,6 @@ void IntegrationPluginGaradget::setupThing(ThingSetupInfo *info)
} }
} }
void IntegrationPluginGaradget::postSetupThing(Thing *thing) void IntegrationPluginGaradget::postSetupThing(Thing *thing)
{ {
@ -71,6 +71,7 @@ void IntegrationPluginGaradget::postSetupThing(Thing *thing)
int updatetime = 30; int updatetime = 30;
int lwtupdatetime = 300 / updatetime; int lwtupdatetime = 300 / updatetime;
m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(updatetime); m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(updatetime);
connect(m_pluginTimer, &PluginTimer::timeout, this, [=](){ connect(m_pluginTimer, &PluginTimer::timeout, this, [=](){
m_statuscounter[thing] += 1; m_statuscounter[thing] += 1;
foreach (Thing *thing, myThings()) { foreach (Thing *thing, myThings()) {
@ -89,6 +90,7 @@ void IntegrationPluginGaradget::postSetupThing(Thing *thing)
m_statuscounter[thing] = 1; m_statuscounter[thing] = 1;
} }
}); });
connect(thing, &Thing::settingChanged, this, [=](const ParamTypeId &settingTypeId){ connect(thing, &Thing::settingChanged, this, [=](const ParamTypeId &settingTypeId){
foreach (Thing *thing, myThings()) { foreach (Thing *thing, myThings()) {
QJsonObject garadgetobj; QJsonObject garadgetobj;

View File

@ -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,9 +31,8 @@
#ifndef INTEGRATIONPLUGINGARADGET_H #ifndef INTEGRATIONPLUGINGARADGET_H
#define INTEGRATIONPLUGINGARADGET_H #define INTEGRATIONPLUGINGARADGET_H
#include "plugintimer.h" #include <integrations/integrationplugin.h>
#include "integrations/integrationplugin.h" #include <plugintimer.h>
#include "network/networkaccessmanager.h"
#include <QHash> #include <QHash>
#include <QDebug> #include <QDebug>