From 3b7f795803d3c46dabc937334cd6101d0b621190 Mon Sep 17 00:00:00 2001 From: Leonard de Ruijter Date: Sat, 14 Dec 2024 09:44:29 +0100 Subject: [PATCH] Filter for the correct usage page in the Brailliant driver --- source/brailleDisplayDrivers/brailliantB.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/brailleDisplayDrivers/brailliantB.py b/source/brailleDisplayDrivers/brailliantB.py index 67670d80e9d..730ea1552b9 100644 --- a/source/brailleDisplayDrivers/brailliantB.py +++ b/source/brailleDisplayDrivers/brailliantB.py @@ -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. @@ -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(