Skip to content

Commit 7991253

Browse files
Update hid_devices.py
1 parent 25c9467 commit 7991253

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hid_devices.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ class FilterDict(TypedDict):
6868
DEVICES_CONFIG_COMPATIBILITY_DEVICE_KEY = 'compatibility_devices'
6969
CAPTURE_ELEMENT: Literal['capture'] = 'capture'
7070
FILTER_ELEMENT: Literal['filter'] = 'filter'
71-
FILTERS_PATH = Path(__file__).parent / "filters"
71+
# TODO: https://github.com/mypyc/mypyc/issues/700
72+
FILTERS_PATH = Path(".") / "filters" # Path(__file__).parent
7273
REPORT_ID_PATTERN = re.compile(r"(a10185)(..)")
73-
SDP_TEMPLATE_PATH = Path(__file__).with_name("sdp_record_template.xml")
74+
SDP_TEMPLATE_PATH = SDP_TEMPLATE_PATH = Path("sdp_record_template.xml") # Path(__file__).with_name("sdp_record_template.xml")
7475
SDP_OUTPUT_PATH = Path("/etc/bluetooth/sdp_record.xml")
7576

7677
FILTERS: dict[str, FilterDict] = {"_": {"name": "No filter", "func": lambda m: m}}
@@ -147,7 +148,7 @@ def __init__(self, device: _Device, filter: HIDMessageFilter,
147148
print("HID Device ",self.device_id," created")
148149
desc = "".join(f"{b:02x}" for b in _HIDIOCGRDESC(self.hidraw_file))
149150
# Replace report IDs, so they can be remapped later.
150-
self.internal_ids = tuple(m[1] for m in cast(list[str], REPORT_ID_PATTERN.findall(desc)))
151+
self.internal_ids = tuple(m[1] for m in cast(list[tuple[str, str]], REPORT_ID_PATTERN.findall(desc)))
151152
self.descriptor, found = REPORT_ID_PATTERN.subn(r"\1{}", desc)
152153
# Or insert one if no report ID exists.
153154
if found == 0:

0 commit comments

Comments
 (0)