18 lines
381 B
Python
18 lines
381 B
Python
import hid
|
|
import time
|
|
|
|
# Vendor ID and Product ID for the iBridge device
|
|
TOUCHBAR_VENDOR_ID = 0x05ac
|
|
TOUCHBAR_PRODUCT_ID = 0x8600
|
|
|
|
device = hid.device()
|
|
try:
|
|
device.open(TOUCHBAR_VENDOR_ID, TOUCHBAR_PRODUCT_ID)
|
|
device.write([0x02, 0x01]) # Sending Data
|
|
except OSError as e:
|
|
print(f"Failed to open device: {e}")
|
|
finally:
|
|
device.close()
|
|
print("Device closed")
|
|
|
|
|