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

Commit

Permalink
refactored out bluetooth backend wrapper into new library btlewrap
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianKuehnel committed Mar 10, 2018
1 parent 4cca1a2 commit c6fce06
Show file tree
Hide file tree
Showing 23 changed files with 19 additions and 753 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ target/
#PyCharm project files
.idea/
.test_mac
.pytest_cache/
.pytest_cache/
venv
4 changes: 3 additions & 1 deletion demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import logging
import sys

from btlewrap import available_backends, BluepyBackend, GatttoolBackend, PygattBackend

from miflora.miflora_poller import MiFloraPoller, \
MI_CONDUCTIVITY, MI_MOISTURE, MI_LIGHT, MI_TEMPERATURE, MI_BATTERY
from miflora import miflora_scanner, available_backends, BluepyBackend, GatttoolBackend, PygattBackend
from miflora import miflora_scanner


def valid_miflora_mac(mac, pat=re.compile(r"C4:7C:8D:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}")):
Expand Down
12 changes: 0 additions & 12 deletions miflora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,3 @@
sys.version_info.major,
sys.version_info.minor,
sys.executable))


from miflora.backends.bluepy import BluepyBackend # noqa: E402 # pylint: disable=wrong-import-position
from miflora.backends.gatttool import GatttoolBackend # noqa: E402 # pylint: disable=wrong-import-position
from miflora.backends.pygatt import PygattBackend # noqa: E402 # pylint: disable=wrong-import-position
from miflora.backends import BluetoothBackendException # noqa: F401 E402 # pylint: disable=wrong-import-position
_ALL_BACKENDS = [BluepyBackend, GatttoolBackend, PygattBackend]


def available_backends():
"""Returns a list of all available backends."""
return [b for b in _ALL_BACKENDS if b.check_backend()]
114 changes: 0 additions & 114 deletions miflora/backends/__init__.py

This file was deleted.

105 changes: 0 additions & 105 deletions miflora/backends/bluepy.py

This file was deleted.

Loading

0 comments on commit c6fce06

Please sign in to comment.