From 38272656cf86232e4eb82a08b30147e4c5284e4c Mon Sep 17 00:00:00 2001 From: sqozz Date: Sat, 9 May 2020 16:27:05 +0200 Subject: [PATCH] Cleanup characteristics --- sem6000.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sem6000.py b/sem6000.py index d5f8f1d..4e6795c 100644 --- a/sem6000.py +++ b/sem6000.py @@ -18,9 +18,8 @@ class SEMSocket(): authenticated = False _icon_idx = None _name = None - _read_char = None + _version_char = None _write_char = None - _notify_char = None _name_char = None _btle_device = None @@ -148,15 +147,13 @@ class SEMSocket(): self.disconnect() self._btle_device.connect(self.mac_address) self._btle_handler = self.BTLEHandler(self) + self._btle_device.setDelegate(self._btle_handler) self._custom_service = self._btle_device.getServiceByUUID(0xfff0) - self._read_char = self._custom_service.getCharacteristics("0000fff1-0000-1000-8000-00805f9b34fb")[0] - self._write_char = self._custom_service.getCharacteristics("0000fff3-0000-1000-8000-00805f9b34fb")[0] - self._notify_char = self._custom_service.getCharacteristics("0000fff4-0000-1000-8000-00805f9b34fb")[0] + self._version_char = self._custom_service.getCharacteristics("0000fff1-0000-1000-8000-00805f9b34fb")[0] #contains firmware version info + self._write_char = self._custom_service.getCharacteristics("0000fff3-0000-1000-8000-00805f9b34fb")[0] #is used to write commands self._name_char = self._custom_service.getCharacteristics("0000fff6-0000-1000-8000-00805f9b34fb")[0] - self._btle_device.setDelegate(self._btle_handler) - def disconnect(self): if self.connected == True: self._btle_device.disconnect()