device: fix bug in setting configuration cookie due to bad documentation

This commit is contained in:
Peter F. Patel-Schneider 2024-03-14 16:58:40 -04:00
parent 84524bec3e
commit d76eed85f6
3 changed files with 3 additions and 3 deletions

View File

@ -1729,7 +1729,7 @@ class Hidpp20:
return result return result
def config_change(self, device, configuration, no_reply=False): 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 = { battery_functions = {

View File

@ -232,7 +232,7 @@ def _print_device(dev, num=None):
): ):
print(f" Report Rate: {_hidpp20.get_polling_rate(dev)}") print(f" Report Rate: {_hidpp20.get_polling_rate(dev)}")
elif feature == _hidpp20_constants.FEATURE.CONFIG_CHANGE: 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()}") print(f" Configuration: {response.hex()}")
elif feature == _hidpp20_constants.FEATURE.REMAINING_PAIRING: elif feature == _hidpp20_constants.FEATURE.REMAINING_PAIRING:
print(" Remaining Pairings: %d" % _hidpp20.get_remaining_pairing(dev)) print(" Remaining Pairings: %d" % _hidpp20.get_remaining_pairing(dev))

View File

@ -389,7 +389,7 @@ def test_get_remaining_pairing(mock_feature_request):
def test_config_change(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) mock_feature_request.side_effect = partial(feature_request, responses)
result = _hidpp20.config_change(None, 0x2) result = _hidpp20.config_change(None, 0x2)