diff options
author | Ryan O'Beirne | 2019-09-04 16:03:34 -0400 |
---|---|---|
committer | Ryan O'Beirne | 2019-09-04 16:03:34 -0400 |
commit | 313629fa9b39cd5e6a22983f345c438a1dc35524 (patch) | |
tree | 13418705cfaf8f386a317230ae74d1ee901298ee /fixcontroller.py | |
parent | b630fa0212e506303ba2c2a4f5cc5f82015940c7 (diff) | |
download | aur-313629fa9b39cd5e6a22983f345c438a1dc35524.tar.gz |
Add systemd logging
Diffstat (limited to 'fixcontroller.py')
-rwxr-xr-x | fixcontroller.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fixcontroller.py b/fixcontroller.py index 24e48edaf301..54cf89d335c4 100755 --- a/fixcontroller.py +++ b/fixcontroller.py @@ -3,10 +3,13 @@ # https://gist.github.com/dnmodder/de2df973323b7c6acf45f40dc66e8db3 import usb.core +import systemd.journal dev = usb.core.find(idVendor=0x045e, idProduct=0x028e) if dev is None: - raise ValueError('Device not found') + systemd.journal.send('XBox generic controller not found', SYSLOG_IDENTIFIER='xbox-generic-controller') + raise ValueError('Device not found') else: - dev.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14) + dev.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14) + systemd.journal.send('XBox generic controller found and fixed', SYSLOG_IDENTIFIER='xbox-generic-controller') |