2929from  adafruit_ble .uuid  import  VendorUUID 
3030from  adafruit_ble .characteristics  import  Characteristic , ComplexCharacteristic 
3131
32+ try :
33+     from  typing  import  Optional , Tuple 
34+ except  ImportError :
35+     pass 
36+ 
3237__version__  =  "0.0.0-auto.0" 
3338__repo__  =  "https://github.com/adafruit/Adafruit_CircuitPython_BLE_LYWSD03MMC.git" 
3439
@@ -38,10 +43,10 @@ class _Readings(ComplexCharacteristic):
3843
3944    uuid  =  VendorUUID ("ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6" )
4045
41-     def  __init__ (self ):
46+     def  __init__ (self )  ->   None :
4247        super ().__init__ (properties = Characteristic .NOTIFY )
4348
44-     def  bind (self , service ) :
49+     def  bind (self , service :  "LYWSD03MMCService" )  ->   _bleio . PacketBuffer :
4550        """Bind to an LYWSD03MMCService.""" 
4651        bound_characteristic  =  super ().bind (service )
4752        bound_characteristic .set_cccd (notify = True )
@@ -52,7 +57,7 @@ def bind(self, service):
5257class  LYWSD03MMCService (Service ):
5358    """Service for reading from an LYWSD03MMC sensor.""" 
5459
55-     def  __init__ (self , service = None ):
60+     def  __init__ (self , service :  Optional [ "LYWSD03MMCService" ]  =   None )  ->   None :
5661        super ().__init__ (service = service )
5762        # Defer creating buffers until needed, since MTU is not known yet. 
5863        self ._settings_result_buf  =  None 
@@ -63,7 +68,7 @@ def __init__(self, service=None):
6368    readings  =  _Readings ()
6469
6570    @property  
66-     def  temperature_humidity (self ):
71+     def  temperature_humidity (self )  ->   Optional [ Tuple [ float ,  int ]] :
6772        """Return a tuple of (temperature, humidity).""" 
6873        if  self ._readings_buf  is  None :
6974            self ._readings_buf  =  bytearray (self .readings .incoming_packet_length )
0 commit comments