From 0b3d1758838acd88a5fa8a14a05c235311181a6f Mon Sep 17 00:00:00 2001 From: klonfish Date: Mon, 26 Dec 2016 23:08:59 +0100 Subject: [PATCH] Maybe fixed things --- wii-pair/wiiboard.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wii-pair/wiiboard.py b/wii-pair/wiiboard.py index 9e04f7b..1bbc116 100644 --- a/wii-pair/wiiboard.py +++ b/wii-pair/wiiboard.py @@ -55,6 +55,7 @@ class Wiiboard: self.LED = False self.address = None self.buttonDown = False + self.battery = None for i in range(3): self.calibration.append([]) for j in range(4): @@ -66,9 +67,7 @@ class Wiiboard: try: self.datasocket = bluetooth.BluetoothSocket(bluetooth.L2CAP) - self.datasocket.settimeout(2) self.controlsocket = bluetooth.BluetoothSocket(bluetooth.L2CAP) - self.controlsocket.settimeout(2) except ValueError: raise Exception("Error: Bluetooth not found") @@ -84,7 +83,9 @@ class Wiiboard: print("Non existant address") return self.datasocket.connect((address, 0x13)) + self.datasocket.settimeout(2) self.controlsocket.connect((address, 0x11)) + self.controlsocket.settimeout(2) if self.datasocket and self.controlsocket: print("Connected to Wiiboard at address " + address) self.status = "Connected"