diff --git a/CHANGELOG b/CHANGELOG index ce2cf43b..bf50d817 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ jc changelog 20250724 v1.25.6 - Add `x509-crl` file parser to support Certificate Revocation List PEM and DER files +- Fix `bluetoothctl` command parser to support output with the `cable_pairing` attribute - Fix `nmcli` command parser to support blank `team.config` JSON value and `team-port.config` JSON value - Fix `top` command parsers to correct memory size field parsing. Several new unit and byte conversion fields have been added diff --git a/jc/parsers/bluetoothctl.py b/jc/parsers/bluetoothctl.py index 16943bcb..077113d1 100644 --- a/jc/parsers/bluetoothctl.py +++ b/jc/parsers/bluetoothctl.py @@ -64,6 +64,7 @@ a controller and a device but there might be fields corresponding to one entity. "blocked": string, "connected": string, "legacy_pairing": string, + "cable_pairing": string, "rssi": int, "txpower": int, "uuids": array, @@ -112,7 +113,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`bluetoothctl` command parser' author = 'Jake Ob' author_email = 'iakopap at gmail.com' @@ -302,6 +303,7 @@ _device_line_pattern = ( + r"|\s*TxPower:\s*(?P.+)" + r"|\s*Battery\sPercentage:\s*0[xX][0-9a-fA-F]*\s*\((?P[0-9]+)\)" + r"|\s*UUID:\s*(?P.+))" + + r"|\s*CablePairing:\s*(?P.+)" ) @@ -335,6 +337,7 @@ def _parse_device(next_lines: List[str], quiet: bool) -> Optional[Device]: "blocked": '', "connected": '', "legacy_pairing": '', + "cable_pairing": '', "rssi": 0, "txpower": 0, "uuids": [], @@ -383,6 +386,8 @@ def _parse_device(next_lines: List[str], quiet: bool) -> Optional[Device]: device["connected"] = matches["connected"] elif matches["legacy_pairing"]: device["legacy_pairing"] = matches["legacy_pairing"] + elif matches["cable_pairing"]: + device["cable_pairing"] = matches["cable_pairing"] elif matches["rssi"]: rssi = matches["rssi"] try: