Whole file
kellyjonbrazil/jc
The author described this change as “Fix broken controller parser schema to include power state prop (#652)”. It counts as a record because the check below fails on the code as it stood at 834acfb2d and passes on ebbd4e932, with nothing else changed between the two runs.
Projectkellyjonbrazil/jc
Fix saved2025-04-02
Sharing licenceMIT · LICENSE.md
Change size+5 −0
What the code was meant to do, written into the code itself as a save note
Fix broken controller parser schema to include power state prop (#652)
The change
| 139 | 139 | "alias": str, | |
| 140 | 140 | "class": str, | |
| 141 | 141 | "powered": str, | |
| 142 | + | "power_state": str, | |
| 142 | 143 | "discoverable": str, | |
| 143 | 144 | "discoverable_timeout": str, | |
| 144 | 145 | "pairable": str, | |
| ⋯ | |||
| 185 | 186 | + r"|\s*Alias:\s*(?P<alias>.+)" | |
| 186 | 187 | + r"|\s*Class:\s*(?P<class>.+)" | |
| 187 | 188 | + r"|\s*Powered:\s*(?P<powered>.+)" | |
| 189 | + | + r"|\s*PowerState:\s*(?P<power_state>.+)" | |
| 188 | 190 | + r"|\s*Discoverable:\s*(?P<discoverable>.+)" | |
| 189 | 191 | + r"|\s*DiscoverableTimeout:\s*(?P<discoverable_timeout>.+)" | |
| 190 | 192 | + r"|\s*Pairable:\s*(?P<pairable>.+)" | |
| ⋯ | |||
| 219 | 221 | "alias": '', | |
| 220 | 222 | "class": '', | |
| 221 | 223 | "powered": '', | |
| 224 | + | "power_state": '', | |
| 222 | 225 | "discoverable": '', | |
| 223 | 226 | "discoverable_timeout": '', | |
| 224 | 227 | "pairable": '', | |
| ⋯ | |||
| 261 | 264 | controller["class"] = matches["class"] | |
| 262 | 265 | elif matches["powered"]: | |
| 263 | 266 | controller["powered"] = matches["powered"] | |
| 267 | + | elif matches["power_state"]: | |
| 268 | + | controller["power_state"] = matches["power_state"] | |
| 264 | 269 | elif matches["discoverable"]: | |
| 265 | 270 | controller["discoverable"] = matches["discoverable"] | |
| 266 | 271 | elif matches["discoverable_timeout"]: | |
The check that tells the two apart
fail→pass·tests/test_bluetoothctl.py::BluetoothctlTests::test_bluetoothctl_controller_2
Check file tests/test_bluetoothctl.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it834acfb2d63f957fc67ad4273ba97b16a59b6325
Broken version dated2025-03-31
Modulejc.parsers.bluetoothctl
Units changed_parse_controller
Fingerprintaf1b830dce201196
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in kellyjonbrazil/jc
- 2026-03-25parse
- 2026-03-25_process
- 2025-03-31parse
- 2025-03-31fix time parser for missing centiseconds
- 2024-10-18Fix broken controller regexp scheme in the bluetoothctl parser (#599)
- 2024-09-07fix uptime for "user" instead of "users"