Fix show attributes

`show attributes` wasn't being populated since `show_attributes()` was never called.

Also updated `show attributes` to match the color and indentation of `show services`
This commit is contained in:
Alan Rosenthal
2023-01-19 12:21:37 -05:00
parent 8a91c614c7
commit bb297e7516
4 changed files with 42 additions and 28 deletions

View File

@@ -46,7 +46,6 @@ from bumble.hci import (
HCI_LE_Connection_Complete_Event,
HCI_LE_Read_Remote_Features_Complete_Event,
HCI_Number_Of_Completed_Packets_Event,
HCI_Object,
HCI_Packet,
)
@@ -1029,7 +1028,7 @@ class Controller:
}
return bytes([HCI_SUCCESS])
def on_hci_le_read_transmit_power_command(self, command):
def on_hci_le_read_transmit_power_command(self, _command):
'''
See Bluetooth spec Vol 2, Part E - 7.8.74 LE Read Transmit Power Command
'''

View File

@@ -204,7 +204,7 @@ async def open_pyusb_transport(spec):
await self.sink.stop()
usb.util.release_interface(self.device, 0)
usb_find = usb.core.find
usb_find = usb.core.find
try:
import libusb_package
except ImportError:
@@ -215,9 +215,7 @@ async def open_pyusb_transport(spec):
# Find the device according to the spec moniker
if ':' in spec:
vendor_id, product_id = spec.split(':')
device = usb_find(
idVendor=int(vendor_id, 16), idProduct=int(product_id, 16)
)
device = usb_find(idVendor=int(vendor_id, 16), idProduct=int(product_id, 16))
else:
device_index = int(spec)
devices = list(

View File

@@ -51,8 +51,12 @@ def load_libusb():
else:
if libusb_path := libusb_package.get_library_path():
logger.debug(f'loading libusb library at {libusb_path}')
dll_loader = ctypes.WinDLL if platform.system() == 'Windows' else ctypes.CDLL
libusb_dll = dll_loader(str(libusb_path), use_errno=True, use_last_error=True)
dll_loader = (
ctypes.WinDLL if platform.system() == 'Windows' else ctypes.CDLL
)
libusb_dll = dll_loader(
str(libusb_path), use_errno=True, use_last_error=True
)
usb1.loadLibrary(libusb_dll)