16
16
17
17
# For older versions, typing may need to be imported
18
18
try :
19
- from typing import List , Tuple
19
+ from typing import List , Tuple , Optional , Union
20
20
except ImportError :
21
21
pass
22
22
31
31
class NotificationFree (displayio .Group ):
32
32
"""Widget to show when no notifications are active."""
33
33
34
- def __init__ (self , width : int , height : int , * , dark_mode = True ):
34
+ def __init__ (self , width : Union [int , float ], height : Union [int , float ], * ,
35
+ dark_mode : Union [bool , int ]= True ):
35
36
# pylint: disable=unused-argument
36
37
super ().__init__ ()
37
38
@@ -50,7 +51,8 @@ def __init__(self, width: int, height: int, *, dark_mode=True):
50
51
class PlainNotification (displayio .Group ):
51
52
"""Plain text widget with a title and message."""
52
53
53
- def __init__ (self , title : str , message : str , width : int , height : int , * , dark_mode : bool = True ):
54
+ def __init__ (self , title : str , message : str , width : Union [int , float ], height : Union [int , float ],
55
+ * , dark_mode : Union [bool , int ]= True ):
54
56
super ().__init__ ()
55
57
56
58
# Set text, font, and color
0 commit comments