diff --git a/.pylintrc b/.pylintrc index f945e92..82b04fe 100644 --- a/.pylintrc +++ b/.pylintrc @@ -361,7 +361,8 @@ valid-metaclass-classmethod-first-arg=mcs [DESIGN] # Maximum number of arguments for function / method -max-args=5 +# Changed for this library, Adafruit_CircuitPython_BLE +max-args=9 # Maximum number of attributes for a class (see R0902). # max-attributes=7 diff --git a/adafruit_ble/services/standard/device_info.py b/adafruit_ble/services/standard/device_info.py index 19b8004..b8e3762 100644 --- a/adafruit_ble/services/standard/device_info.py +++ b/adafruit_ble/services/standard/device_info.py @@ -14,7 +14,6 @@ import binascii import os import sys -from collections.abc import Iterable from .. import Service from ...uuid import StandardUUID @@ -22,7 +21,7 @@ from ...characteristics.string import FixedStringCharacteristic try: - from typing import Optional, TYPE_CHECKING + from typing import Iterable, Optional, TYPE_CHECKING if TYPE_CHECKING: import _bleio @@ -72,6 +71,10 @@ def __init__( # pylint: disable=too-many-arguments pass if firmware_revision is None: firmware_revision = getattr(os.uname(), "version", None) + if pnp_id is None: + # These values are not necessarily valid according to the spec, + # but they work on Android and iOS. + pnp_id = (0x00, 0x0000, 0x0000, 0x0000) super().__init__( manufacturer=manufacturer, software_revision=software_revision,