Fix operator precedence bug and end-of-configuration timing in device.changed()#3173
Open
ksanislo wants to merge 1 commit intopwr-Solaar:masterfrom
Open
Fix operator precedence bug and end-of-configuration timing in device.changed()#3173ksanislo wants to merge 1 commit intopwr-Solaar:masterfrom
ksanislo wants to merge 1 commit intopwr-Solaar:masterfrom
Conversation
When a HID++ 2.0 device requests software reconfiguration via WIRELESS_DEVICE_STATUS, apply_all_settings runs but set_configuration(0x11) was only sent on the initial offline→online transition. Without the end-of-configuration signal, the device keeps sending reconfiguration requests, causing redundant settings pushes that flood the bus. Send set_configuration(0x11) after every settings push for HID++ 2.0 devices, not just on first activation. This properly acknowledges the reconfiguration and stops the device from retrying. Also fixes an operator precedence issue where `push and (not self.features ...)` bound tighter than the surrounding `or` clauses, making the `push` flag ineffective for devices with WIRELESS_DEVICE_STATUS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
push and (not self.features ...)causedpush=Truefrom WIRELESS_DEVICE_STATUS to only trigger settings push fordevices WITHOUT that feature (the opposite of intended behavior)
set_configuration(0x11)after every settings push, not just on firstactivation — devices that request reconfiguration via WIRELESS_DEVICE_STATUS
need the end-of-configuration acknowledgment or they keep retrying