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.

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

139139 "alias": str,
140140 "class": str,
141141 "powered": str,
142+ "power_state": str,
142143 "discoverable": str,
143144 "discoverable_timeout": str,
144145 "pairable": str,
185186 + r"|\s*Alias:\s*(?P<alias>.+)"
186187 + r"|\s*Class:\s*(?P<class>.+)"
187188 + r"|\s*Powered:\s*(?P<powered>.+)"
189+ + r"|\s*PowerState:\s*(?P<power_state>.+)"
188190 + r"|\s*Discoverable:\s*(?P<discoverable>.+)"
189191 + r"|\s*DiscoverableTimeout:\s*(?P<discoverable_timeout>.+)"
190192 + r"|\s*Pairable:\s*(?P<pairable>.+)"
219221 "alias": '',
220222 "class": '',
221223 "powered": '',
224+ "power_state": '',
222225 "discoverable": '',
223226 "discoverable_timeout": '',
224227 "pairable": '',
261264 controller["class"] = matches["class"]
262265 elif matches["powered"]:
263266 controller["powered"] = matches["powered"]
267+ elif matches["power_state"]:
268+ controller["power_state"] = matches["power_state"]
264269 elif matches["discoverable"]:
265270 controller["discoverable"] = matches["discoverable"]
266271 elif matches["discoverable_timeout"]:

The check that tells the two apart

failpass·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