From d76eed85f681175794795861bd136bfcde022480 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Thu, 14 Mar 2024 16:58:40 -0400 Subject: [PATCH] device: fix bug in setting configuration cookie due to bad documentation --- lib/logitech_receiver/hidpp20.py | 2 +- lib/solaar/cli/show.py | 2 +- tests/logitech_receiver/test_hidpp20_simple.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/logitech_receiver/hidpp20.py b/lib/logitech_receiver/hidpp20.py index a9a71e7b..998cd884 100644 --- a/lib/logitech_receiver/hidpp20.py +++ b/lib/logitech_receiver/hidpp20.py @@ -1729,7 +1729,7 @@ class Hidpp20: return result def config_change(self, device, configuration, no_reply=False): - return feature_request(device, FEATURE.CONFIG_CHANGE, 0x00, configuration, no_reply=no_reply) + return feature_request(device, FEATURE.CONFIG_CHANGE, 0x10, configuration, no_reply=no_reply) battery_functions = { diff --git a/lib/solaar/cli/show.py b/lib/solaar/cli/show.py index 979d6e4b..115e6b45 100644 --- a/lib/solaar/cli/show.py +++ b/lib/solaar/cli/show.py @@ -232,7 +232,7 @@ def _print_device(dev, num=None): ): print(f" Report Rate: {_hidpp20.get_polling_rate(dev)}") elif feature == _hidpp20_constants.FEATURE.CONFIG_CHANGE: - response = dev.feature_request(_hidpp20_constants.FEATURE.CONFIG_CHANGE, 0x10) + response = dev.feature_request(_hidpp20_constants.FEATURE.CONFIG_CHANGE, 0x00) print(f" Configuration: {response.hex()}") elif feature == _hidpp20_constants.FEATURE.REMAINING_PAIRING: print(" Remaining Pairings: %d" % _hidpp20.get_remaining_pairing(dev)) diff --git a/tests/logitech_receiver/test_hidpp20_simple.py b/tests/logitech_receiver/test_hidpp20_simple.py index d2fef8f0..4e0bd5f5 100644 --- a/tests/logitech_receiver/test_hidpp20_simple.py +++ b/tests/logitech_receiver/test_hidpp20_simple.py @@ -389,7 +389,7 @@ def test_get_remaining_pairing(mock_feature_request): def test_config_change(mock_feature_request): - responses = [Response("03FFFF", None, hidpp20.FEATURE.CONFIG_CHANGE, 0x0, (0x2,))] + responses = [Response("03FFFF", None, hidpp20.FEATURE.CONFIG_CHANGE, 0x10, (0x2,))] mock_feature_request.side_effect = partial(feature_request, responses) result = _hidpp20.config_change(None, 0x2)