Skip to content

Commit 3d59b31

Browse files
committed
Use default values when pnp_id is not supplied
1 parent 1a16cf4 commit 3d59b31

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
2020
- repo: https://github.com/pycqa/pylint
21-
rev: v2.17.4
21+
rev: v3.3.0
2222
hooks:
2323
- id: pylint
2424
name: pylint (library code)

adafruit_ble/services/standard/device_info.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class DeviceInfoService(Service):
4646
manufacturer = FixedStringCharacteristic(uuid=StandardUUID(0x2A29))
4747
pnp_id = StructCharacteristic("<BHHH", uuid=StandardUUID(0x2A50))
4848

49-
def __init__(
49+
def __init__( # pylint: disable=too-many-arguments
5050
self,
5151
*,
5252
manufacturer: Optional[str] = None,
@@ -72,6 +72,10 @@ def __init__(
7272
pass
7373
if firmware_revision is None:
7474
firmware_revision = getattr(os.uname(), "version", None)
75+
if pnp_id is None:
76+
# These values are not necessarily valid according to the spec,
77+
# but they work on Android and iOS.
78+
pnp_id = (0x00, 0x0000, 0x0000, 0x0000)
7579
super().__init__(
7680
manufacturer=manufacturer,
7781
software_revision=software_revision,

0 commit comments

Comments
 (0)