File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212_LOGGER = logging .getLogger (__name__ )
1313
14+
1415class s3 (tion ):
1516 uuid = "6e400001-b5a3-f393-e0a9-e50e24dcca9e"
1617 uuid_write = "6e400002-b5a3-f393-e0a9-e50e24dcca9e"
@@ -29,14 +30,13 @@ class s3(tion):
2930 command_SET_PARAMS = 2
3031
3132 def __init__ (self , mac : str ):
32- self ._btle = btle .Peripheral (None )
33- self ._mac = mac
33+ super ().__init__ (mac )
3434
3535 def __try_get_state (self ) -> bytearray :
3636 return self ._btle .getServiceByUUID (self .uuid ).getCharacteristics ()[0 ].read ()
3737
3838 def pair (self ):
39- def get_pair_command (self ) -> bytearray :
39+ def get_pair_command () -> bytearray :
4040 return self .create_command (self .command_PAIR )
4141
4242 self ._btle .connect (self .mac , btle .ADDR_TYPE_RANDOM )
Original file line number Diff line number Diff line change 22import logging
33from typing import Callable
44
5+ from bluepy import btle
6+
57_LOGGER = logging .getLogger (__name__ )
68
9+
710class TionException (Exception ):
811 def __init__ (self , expression , message ):
912 self .expression = expression
@@ -17,6 +20,7 @@ class tion:
1720
1821 def __init__ (self , mac : str ):
1922 self ._mac = mac
23+ self ._btle : btle .Peripheral = btle .Peripheral (None )
2024
2125 @abc .abstractmethod
2226 def _send_request (self , request : bytearray ) -> bytearray :
You can’t perform that action at this time.
0 commit comments