Skip to content

Commit

Permalink
Filter for the correct usage page in the Brailliant driver
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonarddeR authored and SaschaCowley committed Dec 17, 2024
1 parent 7df9590 commit 3b7f795
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/brailleDisplayDrivers/brailliantB.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
HR_KEYS = b"\x04"
HR_BRAILLE = b"\x05"
HR_POWEROFF = b"\x07"
HID_USAGE_PAGE = 0x93

KEY_NAMES = {
1: "power", # Brailliant BI 32, 40 and 80.
Expand Down Expand Up @@ -147,6 +148,9 @@ def __init__(self, port="auto"):
# Try talking to the display.
try:
if self.isHid:
if (usasePage := portInfo.get("HIDUsagePage")) != HID_USAGE_PAGE:
log.debugWarning(f"Ignoring device {port!r} with usage page {usasePage!r}")
continue
self._dev = hwIo.Hid(port, onReceive=self._hidOnReceive)
else:
self._dev = hwIo.Serial(
Expand Down

0 comments on commit 3b7f795

Please sign in to comment.