from sh import bluetoothctl

mac = "5B:57:72:BF:86:45"

x=bluetoothctl("info",mac)
#print (x)

for line in x:
    if 'Name:' in line:
        name = line.split(': ')[1].strip()
    if 'RSSI:' in line:
        rssi= line.split(': ')[1].strip()
        break

print("Name:", name)
print("RSSI:", rssi)

