humble_explorer package#
HumBLE Explorer: Human-Friendly Bluetooth Low Energy Explorer.
This is a cross-platform (Windows, Linux, macOS) human-friendly program to scan for Bluetooth Low Energy (BLE) advertisements on the command line.
Submodules#
humble_explorer.app module#
Module with the Textual app that scans for Bluetooth Low Energy advertisements.
- class humble_explorer.app.BLEScannerApp(cli_args: Namespace)[source]#
Bases:
App
[None
]A Textual app to scan for Bluetooth Low Energy advertisements.
- BINDINGS: ClassVar[list[BindingType]] = [('q', 'quit', 'Quit'), ('f', 'toggle_filter', 'Filter'), ('s', 'toggle_settings', 'Settings'), ('t', 'toggle_scan', 'Toggle scan'), ('c', 'clear_advertisements', 'Clear')]#
- add_advertisement_to_table(table: DataTable, now: RichTime, device_address: RichDeviceAddress, rich_advertisement: RichAdvertisement) None [source]#
Add new row to table with time, address and advertisement.
- Parameters:
table (textual.widgets.DataTable) – The table to add an advertisement to.
now (RichTime) – The time.
device_address (RichDeviceAddress) – The device address.
rich_advertisement (RichAdvertisement) – The advertisement.
- compose() Iterable[Widget] [source]#
Create child widgets for the app.
- Returns:
The child widgets for the app.
- Return type:
textual.app.ComposeResult
- async on_advertisement(device: BLEDevice, advertisement_data: AdvertisementData) None [source]#
Show advertisement data on detection of a BLE advertisement.
- Parameters:
device (BLEDevice) – The device advertising the data.
advertisement_data (AdvertisementData) – The advertised data.
- on_input_changed(message: Changed) None [source]#
Filter advertisements with user-supplied filter.
- Parameters:
message (textual.widgets.Input.Changed) – The message with the user’s changed input.
- on_switch_changed(message: Changed) None [source]#
React when the switch is ticked or unticked.
Show or hide advertisement data depending on the state of the switches.
- Parameters:
message (textual.widgets.Switch.Changed) – The message with the changed switch.
- show_data_config() dict[str, bool] [source]#
Return dictionary with which advertisement data to show.
- sub_title: Reactive[str]#
The sub-title for the application.
The initial value in a running application will be that set in SUB_TITLE (if one is set). Assign new values to this instance attribute to change the sub-title.
humble_explorer.renderables module#
Module with Rich renderables for HumBLE Explorer’s user interface.
- class humble_explorer.renderables.RichAdvertisement(data: AdvertisementData, show_data: dict[str, bool])[source]#
Bases:
object
Rich renderable that shows advertisement data.
- class humble_explorer.renderables.RichCompanyID(cic: int)[source]#
Bases:
object
Rich renderable that shows company ID and name.
- class humble_explorer.renderables.RichDeviceAddress(address: str)[source]#
Bases:
object
Rich renderable that shows a Bluetooth device address aand OUI description.
Every address is rendered in its own color.
- class humble_explorer.renderables.RichHexData(data: bytes)[source]#
Bases:
object
Rich renderable that shows hex data.
- class humble_explorer.renderables.RichHexString(data: bytes)[source]#
Bases:
object
Rich renderable that shows hex data as a string.
Non-printable characters are replaced by a dot.
- class humble_explorer.renderables.RichRSSI(rssi: int)[source]#
Bases:
object
Rich renderable that shows RSSI of a device.
humble_explorer.utils module#
This module contains utility functions for HumBLE Explorer.
humble_explorer.widgets module#
This module contains Textual widgets for HumBLE Explorer’s user interface.
- class humble_explorer.widgets.FilterWidget(placeholder: str = '')[source]#
Bases:
Input
A Textual widget to filter Bluetooth Low Energy advertisements.