Repository navigation
fix(devices): tell "for Mac" models apart by extended model ID (#106) - #181
Merged
Merged
Conversation
MX Master 3 and MX Master 3 for Mac share every product ID, as do the MX Master 3S and MX Anywhere 3 and their Mac editions, so Logitune showed the Mac models under the retail name. Logitech Options+ tells them apart by the extended model ID that HID++ DeviceInformation (0x0003) getDeviceInfo returns after the model IDs. - DeviceInfo::parseDeviceInfo reads the getDeviceInfo reply (layout as in Solaar's hidpp20.get_ids, extended model ID at byte 13). Enumeration reuses the reply it already fetched for the entity count and logs the model IDs and extended model ID at debug level. - Descriptors gain an optional "variants" list (schema + JsonDevice): extendedModel -> name, plus optional per-view images; anything a variant leaves out comes from the descriptor. - DeviceSession resolves the variant after matching the descriptor, so the device card, tray and device images use the variant's name and images. - Variants for MX Master 3 (ext 3), MX Master 3S (ext 3, 4, 11) and MX Anywhere 3 (ext 4), taken from the Options+ device catalogue. Tests: getDeviceInfo parsing from raw frames; variant parsing, bad and duplicate entries, and refresh in JsonDevice; a VariantSpec table that checks each mapping against the shipped descriptors; session and model tests for the name and per-view image fallback.
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.
Fixes #106
Problem
MX Master 3 and MX Master 3 for Mac share every product ID. The same goes for the MX Master 3S and MX Anywhere 3 and their Mac editions. As a result, Logitune shows a Mac model under the retail name.
How Options+ tells them apart
Logitech Options+ keeps the Mac editions as
derivativeskeyed byextendedModel. That is the extended model ID byte HID++ DeviceInformation (0x0003) getDeviceInfo returns after the per-transport model IDs. The byte layout follows Solaar'shidpp20.get_ids():Changes
DeviceInfo::parseDeviceInfo(src/core/hidpp/features/DeviceInfo.*) parses the getDeviceInfo reply.variantslist (devices/schema.json,JsonDevice):{ "extendedModel": N, "name": "...", "images": { front/side/back } }.extendedModelor a duplicate one are dropped with a warning.DeviceSessionresolves the variant after matching the descriptor. The device card, tray and device images now read name and images through the session/PhysicalDeviceinstead of the descriptor directly.Tests
JsonDevicevariant parsing, invalid and duplicate entries, and refresh dropping removed variants.VariantSpectable checking each mapping against the shipped descriptors.DeviceSession/DeviceModeltests for the variant name and the per-view image fallback.All suites pass:
logitune-tests(842), tray tests (9) and QML tests (72).Hardware
Smoke-tested on an MX Master 3S For Business over a Bolt receiver. It logs
DeviceInfo: transports=0x2 modelIds=b035,0,0 extendedModelId=0:No Mac-edition hardware was available, so only the unit tests cover the rename path.
🤖 Generated with Claude Code