Skip to content

Commit e8c7d7b

Browse files
Satisfy black
1 parent c936f92 commit e8c7d7b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

adafruit_ble_broadcastnet.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
def broadcast(measurement, *, broadcast_time=0.1, extended=False):
4848
"""Broadcasts the given measurement for the given broadcast time. If extended is False and the
49-
measurement would be too long, it will be split into multiple measurements for transmission.
50-
"""
49+
measurement would be too long, it will be split into multiple measurements for transmission.
50+
"""
5151
global _sequence_number # pylint: disable=global-statement,invalid-name
5252
for submeasurement in measurement.split(252 if extended else 31):
5353
submeasurement.sequence_number = _sequence_number
@@ -83,7 +83,9 @@ class AdafruitSensorMeasurement(Advertisement):
8383
# This prefix matches all
8484
match_prefixes = (
8585
# Matches the sequence number field header (length+ID)
86-
struct.pack("<BHBH", _MANUFACTURING_DATA_ADT, _ADAFRUIT_COMPANY_ID, 0x03, 0x0003),
86+
struct.pack(
87+
"<BHBH", _MANUFACTURING_DATA_ADT, _ADAFRUIT_COMPANY_ID, 0x03, 0x0003
88+
),
8789
)
8890

8991
manufacturer_data = LazyObjectField(
@@ -178,7 +180,7 @@ def __str__(self):
178180
if value is not None:
179181
parts.append("{}={}".format(attr, str(value)))
180182
return "<{} {} >".format(self.__class__.__name__, " ".join(parts))
181-
183+
182184
def __bytes__(self):
183185
"""The raw packet bytes."""
184186
# Must reorder the ManufacturerData contents so the sequence number field is always first.
@@ -188,7 +190,7 @@ def __bytes__(self):
188190

189191
def split(self, max_packet_size=31):
190192
"""Split the measurement into multiple measurements with the given max_packet_size. Yields
191-
each submeasurement."""
193+
each submeasurement."""
192194
current_size = 8 # baseline for mfg data and sequence number
193195
if current_size + len(self.manufacturer_data) < max_packet_size:
194196
yield self

examples/ble_broadcastnet_scan_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
for advert in ble.start_scan(
1212
adafruit_ble_broadcastnet.AdafruitSensorMeasurement, interval=0.5
1313
):
14-
print(advert)
14+
print(advert)

0 commit comments

Comments
 (0)