Skip to content

Commit 8e72726

Browse files
committed
Annotate services/midi.py
1 parent ab45265 commit 8e72726

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

adafruit_ble/services/midi.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
from ..uuid import VendorUUID
1515
from ..characteristics import Characteristic
1616

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

@@ -24,7 +29,7 @@ class MidiIOCharacteristic(Characteristic):
2429
# pylint: disable=too-few-public-methods
2530
uuid = VendorUUID("7772E5DB-3868-4112-A1A9-F2669D106BF3")
2631

27-
def __init__(self, **kwargs):
32+
def __init__(self, **kwargs) -> None:
2833
super().__init__(
2934
properties=(
3035
Characteristic.NOTIFY
@@ -43,7 +48,7 @@ class MidiService(Service):
4348
io = MidiIOCharacteristic() # pylint: disable=invalid-name
4449

4550
# pylint: disable=unnecessary-pass
46-
def write(self):
51+
def write(self) -> None:
4752
"""Placeholder for transmitting midi bytes to the other device."""
4853
pass
4954
# add timestamp to writes 13-bit millisecond resolution
@@ -59,6 +64,6 @@ def write(self):
5964
# high timestamp header byte. Low timestamp packets may wrap around and the decoder is
6065
# responsible for incrementing the high bits
6166

62-
def read(self):
67+
def read(self) -> None:
6368
"""Placeholder for receiving midi bytes from the other device."""
6469
pass

0 commit comments

Comments
 (0)