Skip to content

Commit 0bb527d

Browse files
committed
fixed service type and removed throw error return types
1 parent 981f1eb commit 0bb527d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_ble_magic_light.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ class MagicLightService(Service):
3333
uuid=VendorUUID("0000ffe9-0000-1000-8000-00805f9b34fb"), max_length=7
3434
)
3535

36-
def __init__(self, service: None = None) -> None:
36+
def __init__(self, service: Optional["MagicLightService"] = None) -> None:
3737
super().__init__(service=service)
3838
self._color = 0xFFFFFF
3939
self._buf = bytearray(7)
4040
self._buf[0] = 0x56
4141
self._buf[6] = 0xAA
4242
self._brightness = 1.0
4343

44-
def __getitem__(self, index: int) -> IndexError | int:
44+
def __getitem__(self, index: int) -> int:
4545
if index > 0:
4646
raise IndexError()
4747
return self._color
4848

49-
def __setitem__(self, index: int, value: int) -> Optional[IndexError]:
49+
def __setitem__(self, index: int, value: int) -> None:
5050
if index > 0:
5151
raise IndexError()
5252
if isinstance(value, int):

0 commit comments

Comments
 (0)