Skip to content

Commit 2b256c1

Browse files
committed
run black after updating from v22 to v24
1 parent 25669d3 commit 2b256c1

10 files changed

+30
-28
lines changed

bleak/__init__.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,13 @@ class ExtraArgs(TypedDict, total=False):
287287
@classmethod
288288
async def discover(
289289
cls, timeout: float = 5.0, *, return_adv: Literal[False] = False, **kwargs
290-
) -> List[BLEDevice]:
291-
...
290+
) -> List[BLEDevice]: ...
292291

293292
@overload
294293
@classmethod
295294
async def discover(
296295
cls, timeout: float = 5.0, *, return_adv: Literal[True], **kwargs
297-
) -> Dict[str, Tuple[BLEDevice, AdvertisementData]]:
298-
...
296+
) -> Dict[str, Tuple[BLEDevice, AdvertisementData]]: ...
299297

300298
@classmethod
301299
async def discover(
@@ -526,12 +524,14 @@ def __init__(
526524

527525
self._backend = PlatformBleakClient(
528526
address_or_ble_device,
529-
disconnected_callback=None
530-
if disconnected_callback is None
531-
else functools.partial(disconnected_callback, self),
532-
services=None
533-
if services is None
534-
else set(map(normalize_uuid_str, services)),
527+
disconnected_callback=(
528+
None
529+
if disconnected_callback is None
530+
else functools.partial(disconnected_callback, self)
531+
),
532+
services=(
533+
None if services is None else set(map(normalize_uuid_str, services))
534+
),
535535
timeout=timeout,
536536
winrt=winrt,
537537
**kwargs,

bleak/assigned_numbers.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
See <https://www.bluetooth.com/specifications/assigned-numbers/>.
88
"""
99

10-
1110
from enum import IntEnum
1211

1312

bleak/backends/bluezdbus/client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ def on_value_changed(char_path: str, value: bytes) -> None:
188188
watcher
189189
)
190190

191-
self._disconnect_monitor_event = (
192-
local_disconnect_monitor_event
193-
) = asyncio.Event()
191+
self._disconnect_monitor_event = local_disconnect_monitor_event = (
192+
asyncio.Event()
193+
)
194194

195195
try:
196196
try:

bleak/backends/corebluetooth/PeripheralDelegate.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ async def discover_characteristics(self, service: CBService) -> NSArray:
127127
async def discover_descriptors(self, characteristic: CBCharacteristic) -> NSArray:
128128
future = self._event_loop.create_future()
129129

130-
self._characteristic_descriptor_discover_futures[
131-
characteristic.handle()
132-
] = future
130+
self._characteristic_descriptor_discover_futures[characteristic.handle()] = (
131+
future
132+
)
133133
try:
134134
self.peripheral.discoverDescriptorsForCharacteristic_(characteristic)
135135
await future

bleak/backends/corebluetooth/characteristic.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Created on 2019-06-28 by kevincar <[email protected]>
55
66
"""
7+
78
from enum import Enum
89
from typing import Dict, List, Optional, Tuple, Union
910

bleak/backends/corebluetooth/client.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
Created on 2019-06-26 by kevincar <[email protected]>
55
"""
6+
67
import asyncio
78
import logging
89
import sys
@@ -325,9 +326,11 @@ async def write_gatt_char(
325326
await self._delegate.write_characteristic(
326327
characteristic.obj,
327328
value,
328-
CBCharacteristicWriteWithResponse
329-
if response
330-
else CBCharacteristicWriteWithoutResponse,
329+
(
330+
CBCharacteristicWriteWithResponse
331+
if response
332+
else CBCharacteristicWriteWithoutResponse
333+
),
331334
)
332335
logger.debug(f"Write Characteristic {characteristic.uuid} : {data}")
333336

bleak/backends/corebluetooth/descriptor.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Created on 2019-06-28 by kevincar <[email protected]>
55
66
"""
7+
78
from CoreBluetooth import CBDescriptor
89

910
from ..corebluetooth.utils import cb_uuid_to_str

examples/async_callback_with_queue.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Created on 2021-02-25 by hbldh <[email protected]>
1010
1111
"""
12+
1213
import argparse
1314
import time
1415
import asyncio

examples/scan_iterator.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Created on 2023-07-07 by bojanpotocnik <[email protected]>
88
99
"""
10+
1011
import asyncio
1112

1213
from bleak import BleakScanner

typings/objc/__init__.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@
55
T = TypeVar("T")
66

77

8-
def super(cls: Type[T], self: T) -> T:
9-
...
8+
def super(cls: Type[T], self: T) -> T: ...
109

1110

12-
def macos_available(major: int, minor: int, patch: int = 0) -> bool:
13-
...
11+
def macos_available(major: int, minor: int, patch: int = 0) -> bool: ...
1412

1513

1614
class WeakRef:
17-
def __init__(self, object: NSObject) -> None:
18-
...
15+
def __init__(self, object: NSObject) -> None: ...
1916

20-
def __call__(self) -> Optional[NSObject]:
21-
...
17+
def __call__(self) -> Optional[NSObject]: ...

0 commit comments

Comments
 (0)