device: fix bug in setting configuration cookie due to bad documentation
This commit is contained in:
parent
84524bec3e
commit
d76eed85f6
|
@ -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 = {
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue