From 1056dfa0327aed32f70e4d3df635ce7c7b91be77 Mon Sep 17 00:00:00 2001 From: pixl Date: Mon, 20 Jul 2020 00:07:35 -0400 Subject: [PATCH] Don't use DeviceStatus on unifying devices --- src/logid/features/DeviceStatus.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/logid/features/DeviceStatus.cpp b/src/logid/features/DeviceStatus.cpp index cf03e2a..7ff8a01 100644 --- a/src/logid/features/DeviceStatus.cpp +++ b/src/logid/features/DeviceStatus.cpp @@ -25,6 +25,14 @@ using namespace logid::backend; DeviceStatus::DeviceStatus(logid::Device *dev) : DeviceFeature(dev) { + /* This feature is redundant on receivers since the receiver + * handles wakeup/sleep events. If the device is connected on a + * receiver, pretend this feature is unsupported. + */ + if(dev->hidpp20().deviceIndex() >= hidpp::WirelessDevice1 && + dev->hidpp20().deviceIndex() <= hidpp::WirelessDevice6) + throw UnsupportedFeature(); + try { _wireless_device_status =std::make_shared< hidpp20::WirelessDeviceStatus>(&dev->hidpp20());