Skip to content

Commit 540d4fd

Browse files
committed
Add annotation for services/__init__.py
1 parent a8ff8ba commit 540d4fd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

adafruit_ble/services/__init__.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@
88
99
"""
1010

11+
from __future__ import annotations
12+
1113
import _bleio
1214

1315
from ..characteristics import Characteristic, ComplexCharacteristic
1416

17+
try:
18+
from typing import Optional
19+
except ImportError:
20+
pass
21+
1522
__version__ = "0.0.0-auto.0"
1623
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BLE.git"
1724

@@ -29,7 +36,13 @@ class Service:
2936
instance for the connection's peer.
3037
"""
3138

32-
def __init__(self, *, service=None, secondary=False, **initial_values):
39+
def __init__(
40+
self,
41+
*,
42+
service: Optional[_bleio.Service] = None,
43+
secondary: bool = False,
44+
**initial_values,
45+
) -> None:
3346
if service is None:
3447
# pylint: disable=no-member
3548
self.bleio_service = _bleio.Service(
@@ -70,6 +83,6 @@ def __init__(self, *, service=None, secondary=False, **initial_values):
7083
getattr(self, class_attr)
7184

7285
@property
73-
def remote(self):
86+
def remote(self) -> bool:
7487
"""True if the service is provided by a peer and accessed remotely."""
7588
return self.bleio_service.remote

0 commit comments

Comments
 (0)