Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
added tests for adapter configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianKuehnel committed Nov 27, 2017
1 parent 9014deb commit 0421bdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion miflora/backends/bluepy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def connect(self, mac):
from bluepy.btle import Peripheral
m = re.search(r'hci([\d]+)', self.adapter)
if m is None:
raise ValueError('Invalid pattern for BLuetooth adpater. Expetected something like "hci0".')
raise ValueError('Invalid pattern "{}" for BLuetooth adpater. '
'Expetected something like "hci0".'.format(self.adapter))
iface = int(m.group(1))
self._peripheral = Peripheral(mac, iface=iface)

Expand Down

0 comments on commit 0421bdc

Please sign in to comment.