diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6977a9..fdde2ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,10 +18,10 @@ jobs: awk -F '\/' '{ print tolower($2) }' | tr '_' '-' ) - - name: Set up Python 3.6 + - name: Set up Python 3.7 uses: actions/setup-python@v1 with: - python-version: 3.6 + python-version: 3.7 - name: Versions run: | python3 --version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18efb9c..0950dc6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,10 +20,10 @@ jobs: awk -F '\/' '{ print tolower($2) }' | tr '_' '-' ) - - name: Set up Python 3.6 + - name: Set up Python 3.7 uses: actions/setup-python@v1 with: - python-version: 3.6 + python-version: 3.7 - name: Versions run: | python3 --version diff --git a/adafruit_ble_broadcastnet.py b/adafruit_ble_broadcastnet.py index 2f3d638..0738ba0 100644 --- a/adafruit_ble_broadcastnet.py +++ b/adafruit_ble_broadcastnet.py @@ -30,6 +30,7 @@ """ import struct +import os import time from micropython import const import adafruit_ble @@ -56,12 +57,18 @@ def broadcast(measurement, *, broadcast_time=0.1, extended=False): _sequence_number = (_sequence_number + 1) % 256 -device_address = "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}".format( # pylint: disable=invalid-name - *reversed( - list(_ble._adapter.address.address_bytes) # pylint: disable=protected-access +# This line causes issues with Sphinx, so we won't run it in the CI +if not hasattr(os, "environ") or ( + "GITHUB_ACTION" not in os.environ and "READTHEDOCS" not in os.environ +): + device_address = "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}".format( # pylint: disable=invalid-name + *reversed( + list( + _ble._adapter.address.address_bytes # pylint: disable=protected-access + ) + ) ) -) -"""Device address as a string.""" + """Device address as a string.""" _MANUFACTURING_DATA_ADT = const(0xFF) _ADAFRUIT_COMPANY_ID = const(0x0822) diff --git a/docs/conf.py b/docs/conf.py index 630a5ea..75901c0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,7 +21,7 @@ # Uncomment the below if you use native CircuitPython modules such as # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. -# autodoc_mock_imports = ["digitalio", "busio"] +autodoc_mock_imports = ["bleak", "digitalio", "busio"] intersphinx_mapping = {