File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,19 @@ def __init__(self, mac) -> None:
2121
2222 def _sendpacket (self , key , retry = 2 ) -> bool :
2323 try :
24+ _LOGGER .debug ("Connecting" )
2425 device = bluepy .btle .Peripheral (self ._mac ,
2526 bluepy .btle .ADDR_TYPE_RANDOM )
2627 hand_service = device .getServiceByUUID (UUID )
2728 hand = hand_service .getCharacteristics (HANDLE )[0 ]
29+ _LOGGER .debug ("Sending command, %s" , key )
2830 hand .write (binascii .a2b_hex (key ))
31+ _LOGGER .debug ("Disconnecting" )
2932 device .disconnect ()
3033 except bluepy .btle .BTLEException :
31- _LOGGER .error ("Cannot connect to switchbot." , exc_info = True )
34+ _LOGGER .error ("Cannot connect to switchbot. Retrying " , exc_info = True )
3235 if retry < 1 :
36+ _LOGGER .error ("Cannot connect to switchbot." , exc_info = True )
3337 return False
3438 return self ._sendpacket (key , retry - 1 )
3539 return True
You can’t perform that action at this time.
0 commit comments