From ec4a987fea632a0f603497ea9e912d25cea2e5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 14 Apr 2025 13:49:35 +0200 Subject: [PATCH] Meross: improve datetime performance --- meross/integrationpluginmeross.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meross/integrationpluginmeross.cpp b/meross/integrationpluginmeross.cpp index b10307ee..c9a446cc 100644 --- a/meross/integrationpluginmeross.cpp +++ b/meross/integrationpluginmeross.cpp @@ -124,7 +124,7 @@ void IntegrationPluginMeross::confirmPairing(ThingPairingInfo *info, const QStri QByteArray nonce = QUuid::createUuid().toString().remove(QRegExp("[{}-]")).left(16).toUtf8(); QByteArray initKey = "23x17ahWarFH6w29"; - QByteArray timestamp = QByteArray::number(QDateTime::currentDateTime().toMSecsSinceEpoch() / 1000); + QByteArray timestamp = QByteArray::number(QDateTime::currentMSecsSinceEpoch() / 1000); QByteArray signature = initKey + timestamp + nonce + encodedParams; signature = QCryptographicHash::hash(signature, QCryptographicHash::Md5).toHex(); @@ -374,7 +374,7 @@ QNetworkReply* IntegrationPluginMeross::request(Thing *thing, const QString &nam QByteArray key = m_keys.value(thing); QString messageId = QUuid::createUuid().toString().remove(QRegExp("[{}-]")); - qulonglong timestamp = QDateTime::currentDateTime().toMSecsSinceEpoch(); + qulonglong timestamp = QDateTime::currentMSecsSinceEpoch(); quint16 timestampMs = timestamp % 1000; timestamp = timestamp / 1000; QByteArray signature = QCryptographicHash::hash(QString(messageId + key + QString::number(timestamp)).toUtf8(), QCryptographicHash::Md5).toHex();