Skip to content

Commit

Permalink
Adds get_devices function (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored and eliseomartelli committed Dec 1, 2018
1 parent 81f30fa commit 52ab7ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions googledevices/api/bluetooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ async def get_scan_result(self):
_LOGGER.error('Error connecting to %s - %s', self._ipaddress,
error)

async def get_devices(self, sleep=5):
"""Get bluetooth devices."""
await self.scan_for_devices()
await asyncio.sleep(sleep)
await self.get_scan_result
return self.devices

async def scan_for_devices_multi_run(self, runs=2):
"""Scan for devices multiple times."""
run = 1
Expand Down

0 comments on commit 52ab7ab

Please sign in to comment.