Skip to content

Commit

Permalink
Fix device representation (#97)
Browse files Browse the repository at this point in the history
* Fix device representation

* Remove str cast

* Fix debug output

* Bump version
  • Loading branch information
quaxalber authored Dec 15, 2023
1 parent 636c796 commit 1dba428
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Follow these steps to install and configure the project:
└─5869 python3.11 /home/user/bluetooth_2_usb/bluetooth_2_usb.py --auto_discover --grab_devices

Dec 13 10:33:00 pi0w systemd[1]: Started bluetooth_2_usb.service - Bluetooth to USB HID relay.
Dec 13 10:33:06 pi0w bluetooth_2_usb[5869]: 23-12-13 10:33:06 [INFO] Launching Bluetooth 2 USB v0.7.2
Dec 13 10:33:06 pi0w bluetooth_2_usb[5869]: 23-12-13 10:33:06 [INFO] Launching Bluetooth 2 USB v0.7.4
Dec 13 10:33:06 pi0w bluetooth_2_usb[5869]: 23-12-13 10:33:06 [INFO] Discovering input devices...
Dec 13 10:33:09 pi0w bluetooth_2_usb[5869]: 23-12-13 10:33:09 [INFO] Activated relay for device /dev/input/event2, name "AceRK Mouse", phys "0a:1b:2c:3d:4e:5f"
Dec 13 10:33:09 pi0w bluetooth_2_usb[5869]: 23-12-13 10:33:09 [INFO] Activated relay for device /dev/input/event1, name "AceRK Keyboard", phys "0a:1b:2c:3d:4e:5f"
Expand Down Expand Up @@ -370,7 +370,7 @@ Here's a few things you could try:
user@pi0w:~ $ sudo service bluetooth_2_usb stop && sudo bluetooth_2_usb -d -i hdmi,a1:b2:c3:d4:e5:f6,/dev/input/event3 ; sudo service bluetooth_2_usb start
23-12-15 13:16:01 [DEBUG] CLI args: Arguments(device_ids=['hdmi', 'a1:b2:c3:d4:e5:f6', '/dev/input/event3'], auto_discover=False, grab_devices=False, list_devices=False, log_to_file=False, log_path=/var/log/bluetooth_2_usb/bluetooth_2_usb.log, debug=True, version=False)
23-12-15 13:16:01 [DEBUG] Logging to stdout
23-12-15 13:16:01 [INFO] Launching Bluetooth 2 USB v0.7.2
23-12-15 13:16:01 [INFO] Launching Bluetooth 2 USB v0.7.4
23-12-15 13:16:01 [INFO] Discovering input devices...
23-12-15 13:16:01 [DEBUG] Relaying devices with matching name "hdmi" or MAC "a1:b2:c3:d4:e5:f6" or path "/dev/input/event3"
23-12-15 13:16:01 [DEBUG] Initializing USB gadgets...
Expand Down
2 changes: 1 addition & 1 deletion bluetooth_2_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


_logger = get_logger()
_VERSION = "0.7.2"
_VERSION = "0.7.4"
_VERSIONED_NAME = f"Bluetooth 2 USB v{_VERSION}"


Expand Down
4 changes: 2 additions & 2 deletions src/bluetooth_2_usb/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def init_usb_gadgets() -> None:
_keyboard_gadget = Keyboard(enabled_devices)
_mouse_gadget = Mouse(enabled_devices)
_consumer_gadget = ConsumerControl(enabled_devices)
_logger.debug(f"Enabled USB gadgets: {(str(dev) for dev in enabled_devices)}")
_logger.debug(f"Enabled USB gadgets: {enabled_devices}")


def all_gadgets_ready() -> bool:
Expand Down Expand Up @@ -146,7 +146,7 @@ def _move_mouse(event: RelEvent) -> None:
x, y, mwheel = get_mouse_movement(event)
coordinates = f"(x={x}, y={y}, mwheel={mwheel})"
try:
_logger.debug(f"Moving mouse {_mouse_gadget} {coordinates}")
_logger.debug(f"Moving {_mouse_gadget} {coordinates}")
_mouse_gadget.move(x, y, mwheel)
except Exception:
_logger.exception(f"Failed moving mouse {_mouse_gadget} {coordinates}")
Expand Down

0 comments on commit 1dba428

Please sign in to comment.