btbricks 0.2.3__py3-none-any.whl → 0.2.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
btbricks/__init__.py CHANGED
@@ -7,7 +7,7 @@ use it to create custom Bluetooth peripherals like RC controllers or MIDI
7
7
  devices compatible with LEGO hubs.
8
8
  """
9
9
 
10
- __version__ = "0.2.3"
10
+ __version__ = "0.2.4"
11
11
  __author__ = "Anton Vanhoucke"
12
12
  __license__ = "MIT"
13
13
 
@@ -28,8 +28,22 @@ from .bt import (
28
28
  SETTING1,
29
29
  SETTING2,
30
30
  )
31
- from .bthub import BtHub
32
- from .ctrl_plus import SmartHub
31
+ from .bthub import (
32
+ BtHub,
33
+ OFF,
34
+ PINK,
35
+ PURPLE,
36
+ DARK_BLUE,
37
+ BLUE,
38
+ TEAL,
39
+ GREEN,
40
+ YELLOW,
41
+ ORANGE,
42
+ RED,
43
+ WHITE,
44
+ )
45
+
46
+ from .bthub import BtHub as SmartHub
33
47
 
34
48
  __all__ = [
35
49
  "BLEHandler",
btbricks/bt.py CHANGED
@@ -299,7 +299,6 @@ class BLEHandler:
299
299
 
300
300
  def __init__(self, debug=False):
301
301
  self._ble = ubluetooth.BLE()
302
- self._ble.config(rxbuf=TARGET_MTU)
303
302
  self._ble.active(True)
304
303
  try:
305
304
  self._ble.gap_disconnect(1025) # Disconnect in case of previous crash
@@ -1103,16 +1102,16 @@ class RCReceiver(UARTPeripheral):
1103
1102
 
1104
1103
  """
1105
1104
  try:
1106
- controller_state = struct.unpack("bbbbBBhhB", self.read_buffer)
1105
+ state = struct.unpack("bbbbBBhhB", self.read_buffer)
1107
1106
  except:
1108
- controller_state = [0] * 9
1107
+ state = [0] * 9
1109
1108
  if indices:
1110
1109
  if len(indices) == 1:
1111
- return controller_state[indices[0]]
1110
+ return state[indices[0]]
1112
1111
  else:
1113
- return [controller_state[i] for i in indices]
1112
+ return [state[i] for i in indices]
1114
1113
  else:
1115
- return controller_state
1114
+ return state
1116
1115
 
1117
1116
 
1118
1117
  class RCTransmitter(UARTCentral):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: btbricks
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A MicroPython Bluetooth library for remote controlling LEGO hubs via BLE
5
5
  Home-page: https://github.com/antonvh/btbricks
6
6
  Author: Anton Vanhoucke
@@ -1,14 +1,14 @@
1
- btbricks/__init__.py,sha256=eUuqwGNWUQIA61IJp_p-b79RyEl2bvR_0mQmeQ_beeI,1051
2
- btbricks/bt.py,sha256=JLtXm3RsfpLTbWzGYhrEC1_AMlTpyXHaEoBR1Q5lC7A,44575
1
+ btbricks/__init__.py,sha256=fYiEL6h9s2vBgqGCY-CFqjONW4kU6dNbY4O4sCl64J8,1187
2
+ btbricks/bt.py,sha256=dNV_9K-9xe6DPukl95R24IZIjcWilHTG8arX21F3vrk,44477
3
3
  btbricks/bthub.py,sha256=TVvpVo5E9nIzwmASMTAjjLs0lbY4Su4CYFlBU4KZ3dY,7967
4
4
  btbricks/ctrl_plus.py,sha256=CAnkG_SZ9Zysv4ZUDJ7UE0HTLMGeZYD0JxPEIIf-o6Y,177
5
- btbricks-0.2.3.dist-info/licenses/LICENSE,sha256=yVFkYtNY8Mlp5U_xedI4-O8Hxjg_vu-taxJlv8y-xVk,1078
5
+ btbricks-0.2.4.dist-info/licenses/LICENSE,sha256=yVFkYtNY8Mlp5U_xedI4-O8Hxjg_vu-taxJlv8y-xVk,1078
6
6
  tests/__init__.py,sha256=CtJ2NCOCvkNNpVgAw3XHsKd_S-C36d7Yuq4QfTPmwgg,34
7
7
  tests/test_bthub.py,sha256=9yyBhsydjwN7_yXKzsKTEAxcjW_PqOzwZFcQ2dDv_f0,3298
8
8
  tests/test_constants.py,sha256=L0rIn8VsPIPc80qITblsPu9mQltL85pAFLQl2KQUpGY,2023
9
9
  tests/test_imports.py,sha256=kHrRnueFPnQxU807Bo9Ddr3x4hsryMroUoWC816N-Nc,2147
10
10
  tests/test_precommit_checks.py,sha256=mXDtYdLFDgBdOrMBGZyaGz5Z4QtzSfwFpP7axU_H-WE,7075
11
- btbricks-0.2.3.dist-info/METADATA,sha256=oZGjCxcMEkjr96h-xxk956TLDmdlhEjX4DwwXiRz48o,8160
12
- btbricks-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- btbricks-0.2.3.dist-info/top_level.txt,sha256=nznVmPKoDx79OB6rEM180swD9X5G22V35afi5zon1d8,15
14
- btbricks-0.2.3.dist-info/RECORD,,
11
+ btbricks-0.2.4.dist-info/METADATA,sha256=y4cbuwtX1ylufGrVDMU73lV1UC5N2JYkMs4u4UlHRd4,8160
12
+ btbricks-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ btbricks-0.2.4.dist-info/top_level.txt,sha256=nznVmPKoDx79OB6rEM180swD9X5G22V35afi5zon1d8,15
14
+ btbricks-0.2.4.dist-info/RECORD,,