Skip to content

Commit 57e5ba4

Browse files
authored
Fix BLEDevice arguments on Bleak 1.0.0 (#36)
Fixes #35
1 parent 2a65303 commit 57e5ba4

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

pyproject.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exclude = ["tests"] # tests.*
3232
namespaces = false
3333

3434
[tool.ruff]
35-
select = [
35+
lint.select = [
3636
"B002", # Python does not support the unary prefix increment
3737
"B007", # Loop control variable {name} not used within loop body
3838
"B014", # Exception handler with duplicate exception
@@ -52,7 +52,6 @@ select = [
5252
"N804", # First argument of a class method should be named cls
5353
"N805", # First argument of a method should be named self
5454
"N815", # Variable {name} in class scope should not be mixedCase
55-
"PGH001", # No builtin eval() allowed
5655
"PGH004", # Use specific rule codes when using noqa
5756
"PLC0414", # Useless import alias. Import alias does not rename original package.
5857
"PLC", # pylint
@@ -73,7 +72,6 @@ select = [
7372
"S317", # suspicious-xml-sax-usage
7473
"S318", # suspicious-xml-mini-dom-usage
7574
"S319", # suspicious-xml-pull-dom-usage
76-
"S320", # suspicious-xmle-tree-usage
7775
"S601", # paramiko-call
7876
"S602", # subprocess-popen-with-shell-equals-true
7977
"S604", # call-with-shell-equals-true
@@ -91,13 +89,13 @@ select = [
9189
"T20", # flake8-print
9290
"TID251", # Banned imports
9391
"TRY004", # Prefer TypeError exception for invalid type
94-
"TRY200", # Use raise from to specify exception cause
95-
"TRY302", # Remove exception handler; error is immediately re-raised
92+
"S307", # Use raise from to specify exception cause
93+
"TRY203", # Remove exception handler; error is immediately re-raised
9694
"UP", # pyupgrade
9795
"W", # pycodestyle
9896
]
9997

100-
ignore = [
98+
lint.ignore = [
10199
"D202", # No blank lines allowed after function docstring
102100
"D203", # 1 blank line required before class docstring
103101
"D213", # Multi-line docstring summary should start at the second line
@@ -121,10 +119,10 @@ ignore = [
121119

122120
]
123121

124-
[tool.ruff.isort]
122+
[tool.ruff.lint.isort]
125123
force-sort-within-sections = true
126124
combine-as-imports = true
127125
split-on-trailing-comma = false
128126

129-
[tool.ruff.mccabe]
127+
[tool.ruff.lint.mccabe]
130128
max-complexity = 25

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from bleak.backends.device import BLEDevice
44
from idasen import IdasenDesk
55

6-
FAKE_BLE_DEVICE = BLEDevice("AA:BB:CC:DD:EE:FF", None, {"path": ""}, 0)
6+
FAKE_BLE_DEVICE = BLEDevice("AA:BB:CC:DD:EE:FF", None, {"path": ""})
77

88

99
def height_percent_to_meters(percent: float):

tests/test_connection_management.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async def test_double_connect_call_with_different_bledevice():
6464
async def connect_side_effect():
6565
# call the seccond `connect` while the first is ongoing
6666
mock_idasen_desk.connect.side_effect = MagicMock()
67-
new_ble_device = BLEDevice("AA:BB:CC:DD:EE:AA", None, None, 0)
67+
new_ble_device = BLEDevice("AA:BB:CC:DD:EE:AA", None, None)
6868
await desk.connect(new_ble_device)
6969

7070
mock_idasen_desk.is_connected = False

0 commit comments

Comments
 (0)