Skip to content

Commit

Permalink
feat: use bleak as default adapter on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ttu committed Jul 19, 2024
1 parent dee46fb commit 3a3b16c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions ruuvitag_sensor/adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,15 @@ def get_ble_adapter():
return BleCommunicationNixFile()

if is_ci_env:
# Use BleCommunicationDummy for CI as it can't use BlueZ
# Use BleCommunicationDummy for CI as it can't use Bleak/BlueZ
from ruuvitag_sensor.adapters.dummy import BleCommunicationDummy

return BleCommunicationDummy()

# Use default adapter for platform
if sys.platform.startswith("win") or sys.platform.startswith("darwin"):
from ruuvitag_sensor.adapters.bleak_ble import BleCommunicationBleak
# Bleak is default adapter for all platforms
from ruuvitag_sensor.adapters.bleak_ble import BleCommunicationBleak

return BleCommunicationBleak()

# BlueZ is default for Linux
from ruuvitag_sensor.adapters.nix_hci import BleCommunicationNix

return BleCommunicationNix()
return BleCommunicationBleak()


def is_async_adapter(ble: object):
Expand Down

0 comments on commit 3a3b16c

Please sign in to comment.