Skip to content

Commit 82899ad

Browse files
authored
Merge pull request #12 from adafruit/discord-fix
Using python 3.7 so sphinx is ok with __future__
2 parents 4b5462c + 6707af2 commit 82899ad

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
awk -F '\/' '{ print tolower($2) }' |
1919
tr '_' '-'
2020
)
21-
- name: Set up Python 3.6
21+
- name: Set up Python 3.7
2222
uses: actions/setup-python@v1
2323
with:
24-
python-version: 3.6
24+
python-version: 3.7
2525
- name: Versions
2626
run: |
2727
python3 --version

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
awk -F '\/' '{ print tolower($2) }' |
2121
tr '_' '-'
2222
)
23-
- name: Set up Python 3.6
23+
- name: Set up Python 3.7
2424
uses: actions/setup-python@v1
2525
with:
26-
python-version: 3.6
26+
python-version: 3.7
2727
- name: Versions
2828
run: |
2929
python3 --version

adafruit_ble_broadcastnet.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"""
3131

3232
import struct
33+
import os
3334
import time
3435
from micropython import const
3536
import adafruit_ble
@@ -56,12 +57,18 @@ def broadcast(measurement, *, broadcast_time=0.1, extended=False):
5657
_sequence_number = (_sequence_number + 1) % 256
5758

5859

59-
device_address = "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}".format( # pylint: disable=invalid-name
60-
*reversed(
61-
list(_ble._adapter.address.address_bytes) # pylint: disable=protected-access
60+
# This line causes issues with Sphinx, so we won't run it in the CI
61+
if not hasattr(os, "environ") or (
62+
"GITHUB_ACTION" not in os.environ and "READTHEDOCS" not in os.environ
63+
):
64+
device_address = "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}".format( # pylint: disable=invalid-name
65+
*reversed(
66+
list(
67+
_ble._adapter.address.address_bytes # pylint: disable=protected-access
68+
)
69+
)
6270
)
63-
)
64-
"""Device address as a string."""
71+
"""Device address as a string."""
6572

6673
_MANUFACTURING_DATA_ADT = const(0xFF)
6774
_ADAFRUIT_COMPANY_ID = const(0x0822)

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Uncomment the below if you use native CircuitPython modules such as
2222
# digitalio, micropython and busio. List the modules you use. Without it, the
2323
# autodoc module docs will fail to generate with a warning.
24-
# autodoc_mock_imports = ["digitalio", "busio"]
24+
autodoc_mock_imports = ["bleak", "digitalio", "busio"]
2525

2626

2727
intersphinx_mapping = {

0 commit comments

Comments
 (0)