From 358e0958bb46d6fa20ea4713b222d3d471ea23ee Mon Sep 17 00:00:00 2001 From: vbs Date: Fri, 16 Sep 2016 19:05:47 +0200 Subject: [PATCH] fixed wrong interpretation of bit 6 of the notification byte which indicates if the link could be established (bit cleared) or not (bit set) https://lekensteyn.nl/files/logitech/logitech_hidpp10_specification_for_Unifying_Receivers.pdf --- lib/logitech_receiver/receiver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logitech_receiver/receiver.py b/lib/logitech_receiver/receiver.py index 1bd12722..1a01ba33 100644 --- a/lib/logitech_receiver/receiver.py +++ b/lib/logitech_receiver/receiver.py @@ -80,7 +80,7 @@ class PairedDevice(object): # _log.debug("new PairedDevice(%s, %s, %s)", receiver, number, link_notification) if link_notification is not None: - self.online = bool(ord(link_notification.data[0:1]) & 0x40) + self.online = not bool(ord(link_notification.data[0:1]) & 0x40) self.wpid = _strhex(link_notification.data[2:3] + link_notification.data[1:2]) # assert link_notification.address == (0x04 if unifying else 0x03) kind = ord(link_notification.data[0:1]) & 0x0F