This commit is contained in:
Gilles Boccon-Gibod
2023-10-29 11:32:00 -07:00
parent 49d32f5b5b
commit 9d2f3e932a
4 changed files with 4 additions and 5 deletions

View File

@@ -106,7 +106,7 @@ async def main():
AsyncRunner.spawn(
device.notify_subscriber(
connection,
heart_rate_service.heart_rate_measurement_characteristic
heart_rate_service.heart_rate_measurement_characteristic,
)
)

View File

@@ -125,7 +125,7 @@ def lint(ctx, disable='C,R', errors_only=False):
print(f">>> Running the linter{qualifier}...")
try:
ctx.run(f"pylint {' '.join(options)} bumble apps examples tasks.py")
print("The linter is happy. ✅ 😊 🐝'")
print("The linter is happy. ✅ 😊 🐝")
except UnexpectedExit as exc:
print("Please check your code against the linter messages. ❌")
raise Exit(code=1) from exc

View File

@@ -67,6 +67,7 @@ class Scanner:
self.scan_entries[advertisement.address] = self.ScanEntry(advertisement)
self.emit_update()
# -----------------------------------------------------------------------------
def main(hci_source, hci_sink):
return Scanner(hci_source, hci_sink)

View File

@@ -172,9 +172,7 @@ class Speaker:
connection.on('disconnection', self.on_bluetooth_disconnection)
peer_name = '' if connection.peer_name is None else connection.peer_name
peer_address = connection.peer_address.to_string(False)
self.emit(
'connection', {'peer_name': peer_name, 'peer_address': peer_address}
)
self.emit('connection', {'peer_name': peer_name, 'peer_address': peer_address})
def on_bluetooth_disconnection(self, reason):
print(f'Disconnection ({reason})')