use isort when formatting

This commit is contained in:
Gilles Boccon-Gibod
2025-08-21 14:21:19 -07:00
parent ceefe8b2a5
commit 7aba36302a
198 changed files with 1129 additions and 1321 deletions

View File

@@ -18,26 +18,27 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import logging
import struct
from dataclasses import dataclass
from typing import Optional
from bumble.device import Connection
from bumble import utils
from bumble.att import ATT_Error
from bumble.device import Connection
from bumble.gatt import (
GATT_AUDIO_INPUT_CONTROL_POINT_CHARACTERISTIC,
GATT_AUDIO_INPUT_CONTROL_SERVICE,
GATT_AUDIO_INPUT_DESCRIPTION_CHARACTERISTIC,
GATT_AUDIO_INPUT_STATE_CHARACTERISTIC,
GATT_AUDIO_INPUT_STATUS_CHARACTERISTIC,
GATT_AUDIO_INPUT_TYPE_CHARACTERISTIC,
GATT_GAIN_SETTINGS_ATTRIBUTE_CHARACTERISTIC,
Attribute,
Characteristic,
TemplateService,
CharacteristicValue,
GATT_AUDIO_INPUT_CONTROL_SERVICE,
GATT_AUDIO_INPUT_STATE_CHARACTERISTIC,
GATT_GAIN_SETTINGS_ATTRIBUTE_CHARACTERISTIC,
GATT_AUDIO_INPUT_TYPE_CHARACTERISTIC,
GATT_AUDIO_INPUT_STATUS_CHARACTERISTIC,
GATT_AUDIO_INPUT_CONTROL_POINT_CHARACTERISTIC,
GATT_AUDIO_INPUT_DESCRIPTION_CHARACTERISTIC,
TemplateService,
)
from bumble.gatt_adapters import (
CharacteristicProxy,
@@ -48,7 +49,6 @@ from bumble.gatt_adapters import (
UTF8CharacteristicProxyAdapter,
)
from bumble.gatt_client import ProfileServiceProxy, ServiceProxy
from bumble import utils
# -----------------------------------------------------------------------------
# Logging

View File

@@ -20,25 +20,24 @@ Apple Media Service (AMS).
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import asyncio
import dataclasses
import enum
import logging
from typing import Optional, Iterable, Union
from typing import Iterable, Optional, Union
from bumble import utils
from bumble.device import Peer
from bumble.gatt import (
Characteristic,
GATT_AMS_SERVICE,
GATT_AMS_REMOTE_COMMAND_CHARACTERISTIC,
GATT_AMS_ENTITY_UPDATE_CHARACTERISTIC,
GATT_AMS_ENTITY_ATTRIBUTE_CHARACTERISTIC,
GATT_AMS_ENTITY_UPDATE_CHARACTERISTIC,
GATT_AMS_REMOTE_COMMAND_CHARACTERISTIC,
GATT_AMS_SERVICE,
Characteristic,
TemplateService,
)
from bumble.gatt_client import CharacteristicProxy, ProfileServiceProxy, ServiceProxy
from bumble import utils
# -----------------------------------------------------------------------------
# Logging

View File

@@ -20,6 +20,7 @@ Apple Notification Center Service (ANCS).
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import asyncio
import dataclasses
import datetime
@@ -28,21 +29,19 @@ import logging
import struct
from typing import Optional, Sequence, Union
from bumble import utils
from bumble.att import ATT_Error
from bumble.device import Peer
from bumble.gatt import (
Characteristic,
GATT_ANCS_SERVICE,
GATT_ANCS_NOTIFICATION_SOURCE_CHARACTERISTIC,
GATT_ANCS_CONTROL_POINT_CHARACTERISTIC,
GATT_ANCS_DATA_SOURCE_CHARACTERISTIC,
GATT_ANCS_NOTIFICATION_SOURCE_CHARACTERISTIC,
GATT_ANCS_SERVICE,
Characteristic,
TemplateService,
)
from bumble.gatt_client import CharacteristicProxy, ProfileServiceProxy, ServiceProxy
from bumble.gatt_adapters import SerializableCharacteristicProxyAdapter
from bumble import utils
from bumble.gatt_client import CharacteristicProxy, ProfileServiceProxy, ServiceProxy
# -----------------------------------------------------------------------------
# Constants

View File

@@ -18,22 +18,17 @@
# -----------------------------------------------------------------------------
from __future__ import annotations
from dataclasses import dataclass, field
import enum
import functools
import logging
import struct
from typing import Any, Optional, Union, TypeVar
from collections.abc import Sequence
from dataclasses import dataclass, field
from typing import Any, Optional, TypeVar, Union
from bumble import utils
from bumble import colors
from bumble.profiles.bap import CodecSpecificConfiguration
from bumble import colors, device, gatt, gatt_client, hci, utils
from bumble.profiles import le_audio
from bumble import device
from bumble import gatt
from bumble import gatt_client
from bumble import hci
from bumble.profiles.bap import CodecSpecificConfiguration
# -----------------------------------------------------------------------------
# Logging

View File

@@ -17,16 +17,13 @@
# Imports
# -----------------------------------------------------------------------------
import enum
import struct
import logging
from typing import Optional, Callable, Union, Any
import struct
from typing import Any, Callable, Optional, Union
from bumble import l2cap
from bumble import utils
from bumble import gatt
from bumble import gatt_client
from bumble import gatt, gatt_client, l2cap, utils
from bumble.core import AdvertisingData
from bumble.device import Device, Connection
from bumble.device import Connection, Device
# -----------------------------------------------------------------------------
# Logging

View File

@@ -18,21 +18,18 @@
# -----------------------------------------------------------------------------
from __future__ import annotations
from collections.abc import Sequence
import dataclasses
import enum
import struct
import functools
import logging
import struct
from collections.abc import Sequence
from typing_extensions import Self
from bumble import core
from bumble import hci
from bumble import gatt
from bumble import utils
from bumble import core, gatt, hci, utils
from bumble.profiles import le_audio
# -----------------------------------------------------------------------------
# Logging
# -----------------------------------------------------------------------------

View File

@@ -17,18 +17,13 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import dataclasses
import logging
import struct
from typing import ClassVar, Optional, Sequence
from bumble import core
from bumble import device
from bumble import gatt
from bumble import gatt_adapters
from bumble import gatt_client
from bumble import hci
from bumble import utils
from bumble import core, device, gatt, gatt_adapters, gatt_client, hci, utils
# -----------------------------------------------------------------------------
# Logging

View File

@@ -18,19 +18,18 @@
# -----------------------------------------------------------------------------
from typing import Optional
from bumble.gatt_client import ProfileServiceProxy
from bumble.gatt import (
GATT_BATTERY_SERVICE,
GATT_BATTERY_LEVEL_CHARACTERISTIC,
TemplateService,
GATT_BATTERY_SERVICE,
Characteristic,
CharacteristicValue,
TemplateService,
)
from bumble.gatt_client import CharacteristicProxy
from bumble.gatt_adapters import (
PackedCharacteristicAdapter,
PackedCharacteristicProxyAdapter,
)
from bumble.gatt_client import CharacteristicProxy, ProfileServiceProxy
# -----------------------------------------------------------------------------

View File

@@ -18,8 +18,7 @@
# -----------------------------------------------------------------------------
from __future__ import annotations
from bumble import gatt
from bumble import gatt_client
from bumble import gatt, gatt_client
from bumble.profiles import csip

View File

@@ -17,16 +17,12 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import enum
import struct
from typing import Optional
from bumble import core
from bumble import crypto
from bumble import device
from bumble import gatt
from bumble import gatt_client
from bumble import core, crypto, device, gatt, gatt_client
# -----------------------------------------------------------------------------
# Constants

View File

@@ -25,12 +25,12 @@ from bumble.gatt import (
GATT_HARDWARE_REVISION_STRING_CHARACTERISTIC,
GATT_MANUFACTURER_NAME_STRING_CHARACTERISTIC,
GATT_MODEL_NUMBER_STRING_CHARACTERISTIC,
GATT_REGULATORY_CERTIFICATION_DATA_LIST_CHARACTERISTIC,
GATT_SERIAL_NUMBER_STRING_CHARACTERISTIC,
GATT_SOFTWARE_REVISION_STRING_CHARACTERISTIC,
GATT_SYSTEM_ID_CHARACTERISTIC,
GATT_REGULATORY_CERTIFICATION_DATA_LIST_CHARACTERISTIC,
TemplateService,
Characteristic,
TemplateService,
)
from bumble.gatt_adapters import (
DelegatedCharacteristicProxyAdapter,

View File

@@ -23,11 +23,11 @@ from typing import Optional, Union
from bumble.core import Appearance
from bumble.gatt import (
TemplateService,
Characteristic,
GATT_GENERIC_ACCESS_SERVICE,
GATT_DEVICE_NAME_CHARACTERISTIC,
GATT_APPEARANCE_CHARACTERISTIC,
GATT_DEVICE_NAME_CHARACTERISTIC,
GATT_GENERIC_ACCESS_SERVICE,
Characteristic,
TemplateService,
)
from bumble.gatt_adapters import (
DelegatedCharacteristicProxyAdapter,

View File

@@ -17,10 +17,7 @@ from __future__ import annotations
import struct
from typing import TYPE_CHECKING
from bumble import att
from bumble import gatt
from bumble import gatt_client
from bumble import crypto
from bumble import att, crypto, gatt, gatt_client
if TYPE_CHECKING:
from bumble import device

View File

@@ -18,21 +18,21 @@
# Imports
# -----------------------------------------------------------------------------
import struct
from enum import IntFlag
from typing import Optional
from bumble.gatt import (
TemplateService,
Characteristic,
GATT_BGR_FEATURES_CHARACTERISTIC,
GATT_BGS_FEATURES_CHARACTERISTIC,
GATT_GAMING_AUDIO_SERVICE,
GATT_GMAP_ROLE_CHARACTERISTIC,
GATT_UGG_FEATURES_CHARACTERISTIC,
GATT_UGT_FEATURES_CHARACTERISTIC,
GATT_BGS_FEATURES_CHARACTERISTIC,
GATT_BGR_FEATURES_CHARACTERISTIC,
Characteristic,
TemplateService,
)
from bumble.gatt_adapters import DelegatedCharacteristicProxyAdapter
from bumble.gatt_client import CharacteristicProxy, ProfileServiceProxy, ServiceProxy
from enum import IntFlag
# -----------------------------------------------------------------------------

View File

@@ -16,16 +16,16 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import asyncio
import functools
from dataclasses import dataclass, field
import logging
from dataclasses import dataclass, field
from typing import Any, Optional, Union
from bumble import att, gatt, gatt_adapters, gatt_client
from bumble import att, gatt, gatt_adapters, gatt_client, utils
from bumble.core import InvalidArgumentError, InvalidStateError
from bumble.device import Device, Connection
from bumble import utils
from bumble.device import Connection, Device
from bumble.hci import Address

View File

@@ -17,20 +17,21 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
from enum import IntEnum
import struct
from enum import IntEnum
from typing import Optional
from bumble import core
from bumble.att import ATT_Error
from bumble.gatt import (
GATT_HEART_RATE_SERVICE,
GATT_HEART_RATE_MEASUREMENT_CHARACTERISTIC,
GATT_BODY_SENSOR_LOCATION_CHARACTERISTIC,
GATT_HEART_RATE_CONTROL_POINT_CHARACTERISTIC,
TemplateService,
GATT_HEART_RATE_MEASUREMENT_CHARACTERISTIC,
GATT_HEART_RATE_SERVICE,
Characteristic,
CharacteristicValue,
TemplateService,
)
from bumble.gatt_adapters import (
DelegatedCharacteristicAdapter,

View File

@@ -16,14 +16,16 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import dataclasses
import enum
import struct
from typing import Any
from typing_extensions import Self
from bumble.profiles import bap
from bumble import utils
from bumble.profiles import bap
# -----------------------------------------------------------------------------

View File

@@ -22,16 +22,12 @@ import asyncio
import dataclasses
import enum
import struct
from typing import TYPE_CHECKING, ClassVar, Optional
from bumble import core
from bumble import device
from bumble import gatt
from bumble import gatt_client
from bumble import utils
from typing import Optional, ClassVar, TYPE_CHECKING
from typing_extensions import Self
from bumble import core, device, gatt, gatt_client, utils
# -----------------------------------------------------------------------------
# Constants
# -----------------------------------------------------------------------------

View File

@@ -17,18 +17,15 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import dataclasses
import logging
import struct
from typing import Optional, Sequence, Union
from bumble.profiles.bap import AudioLocation, CodecSpecificCapabilities, ContextType
from bumble import gatt, gatt_adapters, gatt_client, hci
from bumble.profiles import le_audio
from bumble import gatt
from bumble import gatt_adapters
from bumble import gatt_client
from bumble import hci
from bumble.profiles.bap import AudioLocation, CodecSpecificCapabilities, ContextType
# -----------------------------------------------------------------------------
# Logging

View File

@@ -16,8 +16,10 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import dataclasses
import enum
from typing_extensions import Self
from bumble.profiles import le_audio

View File

@@ -22,15 +22,14 @@ import logging
import struct
from bumble.gatt import (
TemplateService,
Characteristic,
GATT_TELEPHONY_AND_MEDIA_AUDIO_SERVICE,
GATT_TMAP_ROLE_CHARACTERISTIC,
Characteristic,
TemplateService,
)
from bumble.gatt_adapters import DelegatedCharacteristicProxyAdapter
from bumble.gatt_client import CharacteristicProxy, ProfileServiceProxy, ServiceProxy
# -----------------------------------------------------------------------------
# Logging
# -----------------------------------------------------------------------------

View File

@@ -17,18 +17,12 @@
# Imports
# -----------------------------------------------------------------------------
from __future__ import annotations
import dataclasses
import enum
from typing import Sequence
from bumble import att
from bumble import utils
from bumble import device
from bumble import gatt
from bumble import gatt_adapters
from bumble import gatt_client
from bumble import att, device, gatt, gatt_adapters, gatt_client, utils
# -----------------------------------------------------------------------------
# Constants

View File

@@ -20,17 +20,18 @@ import struct
from dataclasses import dataclass
from typing import Optional
from bumble.device import Connection
from bumble import utils
from bumble.att import ATT_Error
from bumble.device import Connection
from bumble.gatt import (
Characteristic,
TemplateService,
CharacteristicValue,
GATT_AUDIO_LOCATION_CHARACTERISTIC,
GATT_AUDIO_OUTPUT_DESCRIPTION_CHARACTERISTIC,
GATT_VOLUME_OFFSET_CONTROL_POINT_CHARACTERISTIC,
GATT_VOLUME_OFFSET_CONTROL_SERVICE,
GATT_VOLUME_OFFSET_STATE_CHARACTERISTIC,
GATT_AUDIO_LOCATION_CHARACTERISTIC,
GATT_VOLUME_OFFSET_CONTROL_POINT_CHARACTERISTIC,
GATT_AUDIO_OUTPUT_DESCRIPTION_CHARACTERISTIC,
Characteristic,
CharacteristicValue,
TemplateService,
)
from bumble.gatt_adapters import (
DelegatedCharacteristicProxyAdapter,
@@ -38,7 +39,6 @@ from bumble.gatt_adapters import (
UTF8CharacteristicProxyAdapter,
)
from bumble.gatt_client import ProfileServiceProxy, ServiceProxy
from bumble import utils
from bumble.profiles.bap import AudioLocation
# -----------------------------------------------------------------------------