Use local version of able

This commit is contained in:
Mark Qvist 2025-10-29 12:54:59 +01:00
parent 2e44d49d6b
commit 9b6a51a03e
67 changed files with 5305 additions and 0 deletions

View file

@ -0,0 +1,27 @@
"""Service to run BLE scan for 60 seconds,
and log each `on_device` event.
"""
import time
from able import BluetoothDispatcher
from kivy.logger import Logger
class BLE(BluetoothDispatcher):
def on_device(self, device, rssi, advertisement):
title = device.getName() or device.getAddress()
Logger.info("BLE Device found: %s", title)
def on_error(self, msg):
Logger.error("BLE Error %s", msg)
def main():
ble = BLE()
ble.start_scan()
time.sleep(60)
ble.stop_scan()
if __name__ == "__main__":
main()