diff --git a/lib/logitech_receiver/hidpp10.py b/lib/logitech_receiver/hidpp10.py index 29399c8c..ae4798b7 100644 --- a/lib/logitech_receiver/hidpp10.py +++ b/lib/logitech_receiver/hidpp10.py @@ -189,7 +189,7 @@ class Hidpp10: write_register(device, Registers.THREE_LEDS, v1, v2) def get_notification_flags(self, device: Device): - return self._get_register(device, Registers.NOTIFICATIONS) + return NotificationFlag(self._get_register(device, Registers.NOTIFICATIONS)) def set_notification_flags(self, device: Device, *flag_bits: NotificationFlag): assert device is not None diff --git a/lib/solaar/cli/pair.py b/lib/solaar/cli/pair.py index 21343de6..e2888799 100644 --- a/lib/solaar/cli/pair.py +++ b/lib/solaar/cli/pair.py @@ -38,7 +38,7 @@ def run(receivers, args, find_receiver, _ignore): assert receiver # check if it's necessary to set the notification flags - old_notification_flags = _hidpp10.get_notification_flags(receiver) or 0 + old_notification_flags = _hidpp10.get_notification_flags(receiver) if not (old_notification_flags & hidpp10_constants.NotificationFlag.WIRELESS): _hidpp10.set_notification_flags(receiver, old_notification_flags | hidpp10_constants.NotificationFlag.WIRELESS) diff --git a/tests/logitech_receiver/test_hidpp10.py b/tests/logitech_receiver/test_hidpp10.py index 1c39b0c0..b642608a 100644 --- a/tests/logitech_receiver/test_hidpp10.py +++ b/tests/logitech_receiver/test_hidpp10.py @@ -247,7 +247,7 @@ def test_set_3leds_missing(device, mocker): def test_get_notification_flags(device): result = _hidpp10.get_notification_flags(device) - assert result == int("000900", 16) + assert result == hidpp10_constants.NotificationFlag(int("000900", 16)) def test_set_notification_flags(mocker):