Update .pro and small fixes

remaining issue: button presses and rotation events on tap dial are repeated forever
This commit is contained in:
loosrob 2023-05-01 16:54:36 +02:00
parent cefe81f450
commit f8f06be358
3 changed files with 6 additions and 10 deletions

View File

@ -65,7 +65,7 @@ int HueTapDial::switchId() const
void HueTapDial::setSwitchId(int sensorId) void HueTapDial::setSwitchId(int sensorId)
{ {
m_SwitchId = sensorId; m_switchId = sensorId;
} }
QString HueTapDial::switchUuid() const QString HueTapDial::switchUuid() const
@ -78,7 +78,7 @@ void HueTapDial::setSwitchUuid(const QString &switchUuid)
m_switchUuid = switchUuid; m_switchUuid = switchUuid;
} }
double HueTapDial::level() const int HueTapDial::level() const
{ {
return m_level; return m_level;
} }
@ -96,7 +96,6 @@ void HueTapDial::updateStates(const QVariantMap &sensorMap)
QVariantMap configMap = sensorMap.value("config").toMap(); QVariantMap configMap = sensorMap.value("config").toMap();
if (configMap.contains("reachable")) { if (configMap.contains("reachable")) {
setReachable(configMap.value("reachable", false).toBool()); setReachable(configMap.value("reachable", false).toBool());
// emit reachableChanged????
} }
if (configMap.contains("battery")) { if (configMap.contains("battery")) {

View File

@ -1473,11 +1473,6 @@ void IntegrationPluginPhilipsHue::onTapDialButtonEvent(int buttonCode)
qCDebug(dcPhilipsHue()) << "Unhandled button code received from Hue Tap Dial:" << buttonCode << "Thing name:" << thing->name(); qCDebug(dcPhilipsHue()) << "Unhandled button code received from Hue Tap Dial:" << buttonCode << "Thing name:" << thing->name();
return; 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)); emitEvent(Event(id, m_tapDials.value(tapDial)->id(), ParamList() << param));
} }

View File

@ -12,7 +12,8 @@ SOURCES += \
huelight.cpp \ huelight.cpp \
huemotionsensor.cpp \ huemotionsensor.cpp \
hueremote.cpp \ hueremote.cpp \
huedevice.cpp huedevice.cpp \
huetapdial.cpp
HEADERS += \ HEADERS += \
integrationpluginphilipshue.h \ integrationpluginphilipshue.h \
@ -23,7 +24,8 @@ HEADERS += \
huelight.h \ huelight.h \
huemotionsensor.h \ huemotionsensor.h \
hueremote.h \ hueremote.h \
huedevice.h huedevice.h \
huetapdial.h