From f8f06be358f89c281f59d204db0b6fc04b2c2e39 Mon Sep 17 00:00:00 2001 From: loosrob <79396812+loosrob@users.noreply.github.com> Date: Mon, 1 May 2023 16:54:36 +0200 Subject: [PATCH] Update .pro and small fixes remaining issue: button presses and rotation events on tap dial are repeated forever --- philipshue/huetapdial.cpp | 5 ++--- philipshue/integrationpluginphilipshue.cpp | 5 ----- philipshue/philipshue.pro | 6 ++++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/philipshue/huetapdial.cpp b/philipshue/huetapdial.cpp index 31d64e56..cdc6df99 100644 --- a/philipshue/huetapdial.cpp +++ b/philipshue/huetapdial.cpp @@ -65,7 +65,7 @@ int HueTapDial::switchId() const void HueTapDial::setSwitchId(int sensorId) { - m_SwitchId = sensorId; + m_switchId = sensorId; } QString HueTapDial::switchUuid() const @@ -78,7 +78,7 @@ void HueTapDial::setSwitchUuid(const QString &switchUuid) m_switchUuid = switchUuid; } -double HueTapDial::level() const +int HueTapDial::level() const { return m_level; } @@ -96,7 +96,6 @@ void HueTapDial::updateStates(const QVariantMap &sensorMap) QVariantMap configMap = sensorMap.value("config").toMap(); if (configMap.contains("reachable")) { setReachable(configMap.value("reachable", false).toBool()); - // emit reachableChanged???? } if (configMap.contains("battery")) { diff --git a/philipshue/integrationpluginphilipshue.cpp b/philipshue/integrationpluginphilipshue.cpp index a89b3bfc..48eb2692 100644 --- a/philipshue/integrationpluginphilipshue.cpp +++ b/philipshue/integrationpluginphilipshue.cpp @@ -1473,11 +1473,6 @@ void IntegrationPluginPhilipsHue::onTapDialButtonEvent(int buttonCode) qCDebug(dcPhilipsHue()) << "Unhandled button code received from Hue Tap Dial:" << buttonCode << "Thing name:" << thing->name(); return; } - // codes ending in 2 (e.g. 1002) are short presses; - // for long presses the Dimmer Switch V2 sends 3 codes: - // * codes ending in 0 (e.g. 1000) indicate start of long press - // * codes ending in 3 (e.g. 1003) indicate end of long press --> not yet supported by this plugin, but e.g. LongPressEnded action could be added - // * codes ending in 1 (e.g. 1001) are sent during the long press --> probably for backwards compatibility with earlier version, and therefore not added to this plugin } emitEvent(Event(id, m_tapDials.value(tapDial)->id(), ParamList() << param)); } diff --git a/philipshue/philipshue.pro b/philipshue/philipshue.pro index ac404637..7f433f9e 100644 --- a/philipshue/philipshue.pro +++ b/philipshue/philipshue.pro @@ -12,7 +12,8 @@ SOURCES += \ huelight.cpp \ huemotionsensor.cpp \ hueremote.cpp \ - huedevice.cpp + huedevice.cpp \ + huetapdial.cpp HEADERS += \ integrationpluginphilipshue.h \ @@ -23,7 +24,8 @@ HEADERS += \ huelight.h \ huemotionsensor.h \ hueremote.h \ - huedevice.h + huedevice.h \ + huetapdial.h