@@ -189,7 +189,7 @@ def __init__(self, debug:bool = False) -> None:
189
189
190
190
def __del__ (self ) -> None :
191
191
if not self .simulated :
192
- self .__close ()
192
+ self ._close_port ()
193
193
194
194
def __dbg (self , msg :str ) -> None :
195
195
if self .AILLIO_DEBUG and not self .simulated :
@@ -198,7 +198,7 @@ def __dbg(self, msg:str) -> None:
198
198
except OSError :
199
199
pass
200
200
201
- def __open (self ) -> None :
201
+ def _open_port (self ) -> None :
202
202
if self .simulated :
203
203
return
204
204
if self .usbhandle is not None :
@@ -336,7 +336,7 @@ def __open(self) -> None:
336
336
self .ep_in = None
337
337
raise OSError (f'Failed to configure device: { str (e )} ' ) from e
338
338
339
- def __close (self ) -> None :
339
+ def _close_port (self ) -> None :
340
340
if self .simulated :
341
341
return
342
342
@@ -412,7 +412,7 @@ def __updatestate(self, p:'Connection') -> None:
412
412
try :
413
413
# Check connection periodically
414
414
if self .usbhandle is None :
415
- self .__open ()
415
+ self ._open_port ()
416
416
417
417
if self .protocol == 1 :
418
418
# V1 protocol - read two 64 byte frames
@@ -576,7 +576,7 @@ def __getstate(self) -> None:
576
576
return
577
577
# Check connection periodically
578
578
if self .usbhandle is None :
579
- self .__open ()
579
+ self ._open_port ()
580
580
581
581
582
582
def get_roast_number (self ) -> int :
@@ -1137,7 +1137,7 @@ def set_preheat(self, temp: int) -> None:
1137
1137
if __name__ == '__main__' :
1138
1138
R1 = AillioR1 (debug = False )
1139
1139
try :
1140
- R1 .__open () # pylint: disable=protected-access
1140
+ R1 ._open_port ()
1141
1141
print (f"Connected to { R1 .model } using protocol V{ R1 .protocol } " )
1142
1142
1143
1143
# Example reading loop
@@ -1157,4 +1157,4 @@ def set_preheat(self, temp: int) -> None:
1157
1157
except OSError as e :
1158
1158
print (f"Error: { e } " )
1159
1159
finally :
1160
- R1 .__close () # pylint: disable=protected-access
1160
+ R1 ._close_port ()
0 commit comments