From 3a68a0109ee179e2b38c4c5543fcd7bf264fc109 Mon Sep 17 00:00:00 2001 From: ErrorJan Date: Mon, 3 Aug 2020 14:16:51 +0200 Subject: [PATCH] BLESession.handle_request: Simplify Peripheral constructor call Passing the device variable itself into Peripheral() will give the addr, addrType and the iface to the Peripheral(). --- scratch_link.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scratch_link.py b/scratch_link.py index dd3bddf..0e9c7ba 100755 --- a/scratch_link.py +++ b/scratch_link.py @@ -549,8 +549,7 @@ class BLESession(Session): self.device = self.found_devices[params['peripheralId']] self.deviceName = self.device.getValueText(0x9) or self.device.getValueText(0x8) try: - self.perip = Peripheral(self.device.addr, - self.device.addrType) + self.perip = Peripheral(self.device) logger.info(f"connected to the BLE peripheral: {self.deviceName}") except BTLEDisconnectError as e: logger.error(f"failed to connect to the BLE device \"{self.deviceName}\": {e}")