What I am wondering is how I can loop through paired_devices and get the "name" attribute for each device. This is only a short amount of the code, if more is needed, feel free to comment below.
def parse_device_info(self, info_string):
attribute_list = info_string[device_position:].split(" ", 2)
device = {
"mac_address": attribute_list[1],
"name": attribute_list[2]
}
return device
if__name__ == "__main__":
#Bluetoothctl is the class that has the get_paired_devices() method
bl = Bluetoothctl()
#get_paired_devices() returns an array of devices, using parse_device_info()
paired_devices = bl.get_paired_devices()