Skip to content

Commit

Permalink
add compatibility to bluetoothconnecter 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
godbout committed May 22, 2020
1 parent bb5befb commit 4eec7db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/get_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import re
import json

devicesRaw = os.popen('/bin/bash -c /usr/local/bin/BluetoothConnector').read()
TRUE, pout = os.popen4('/bin/bash -c /usr/local/bin/BluetoothConnector')
devicesRaw = pout.read()

deviceMacs = []
deviceNames = []
airPodsPosition = -1

macsRegex = r"(?!Usage|Get|\n)^\S*"
macsRegex = r"^([0-9A-Fa-f]{2}[-]){5}([0-9A-Fa-f]{2})"
macsMatches = re.finditer(macsRegex, devicesRaw, re.MULTILINE)

for matchNum, match in enumerate(macsMatches, start=1):
Expand Down

0 comments on commit 4eec7db

Please sign in to comment.