bluetooth.scanner
Platypush documentation
bluetooth.scanner
- class platypush.backend.bluetooth.scanner.BluetoothScannerBackend(device_id: Optional[int] = None, scan_duration: int = 10, track_devices: Optional[List[str]] = None, **kwargs)[source]
Bases:
SensorBackend
This backend periodically scans for available bluetooth devices and returns events when a devices enter or exits the range.
Triggers:
platypush.message.event.bluetooth.BluetoothDeviceFoundEvent
when a new bluetooth device is found.platypush.message.event.bluetooth.BluetoothDeviceLostEvent
when a bluetooth device is lost.
Requires:
The
platypush.plugins.bluetooth.BluetoothPlugin
plugin working.
- __init__(device_id: Optional[int] = None, scan_duration: int = 10, track_devices: Optional[List[str]] = None, **kwargs)[source]
- Parameters:
device_id – Bluetooth adapter ID to use (default configured on the
bluetooth
plugin if None).scan_duration – How long the scan should run (default: 10 seconds).
track_devices – List of addresses of devices to actively track, even if they aren’t discoverable.