@@ -771,7 +771,7 @@ def _maintenance_on(
771771 Turn Maintenance mode on.
772772 """
773773 if initial_state is State .IDLE :
774- print (f 'Turning Maintenance mode on...' )
774+ print ('Turning Maintenance mode on...' )
775775
776776 _toggle_maintenance (modbus_client = modbus_client , enable = True )
777777
@@ -794,7 +794,7 @@ def _maintenance_off(modbus_client: client.ModbusClient) -> None:
794794 """
795795 Turn Maintenance mode off.
796796 """
797- print (f 'Turning Maintenance mode off...' )
797+ print ('Turning Maintenance mode off...' )
798798
799799 _toggle_maintenance (modbus_client = modbus_client , enable = False )
800800
@@ -808,7 +808,8 @@ def _maintenance_off(modbus_client: client.ModbusClient) -> None:
808808
809809
810810def _check_refilling_state (
811- modbus_client : client .ModbusClient , expected_refilling_state : RefillingState
811+ modbus_client : client .ModbusClient ,
812+ expected_refilling_state : RefillingState
812813) -> None :
813814 """
814815 Check specific refilling state.
@@ -875,8 +876,8 @@ def _perform_draining(modbus_client: client.ModbusClient) -> None:
875876 )
876877
877878 print (
878- f '\n =================================================================\n '
879- f '============================ DRAINING ===========================\n \n '
879+ '\n =================================================================\n '
880+ '============================ DRAINING ===========================\n \n '
880881 )
881882 _wait_confirmation (
882883 prompt = (
@@ -898,8 +899,8 @@ def _perform_flushing(modbus_client: client.ModbusClient) -> None:
898899 Flushing procedure with required checks.
899900 """
900901 print (
901- f '\n =================================================================\n '
902- f '============================ FLUSHING ===========================\n \n '
902+ '\n =================================================================\n '
903+ '============================ FLUSHING ===========================\n \n '
903904 )
904905
905906 _check_refilling_state (
@@ -925,7 +926,8 @@ def _perform_flushing(modbus_client: client.ModbusClient) -> None:
925926 f'\n Now electrolyser will be automatically refilled with'
926927 f' water.\n Current electrolyte level will be reported every'
927928 f' { ELECTROLYTE_PRESENCE_CHECK_TIMEOUT } seconds until flushing is'
928- f' complete.\n Type { INPUT_CONFIRMATION } and press Enter to proceed:'
929+ f' complete.\n Type { INPUT_CONFIRMATION } and press Enter to'
930+ f' proceed:'
929931 )
930932 )
931933
@@ -940,8 +942,8 @@ def _perform_flushing(modbus_client: client.ModbusClient) -> None:
940942
941943 _print_yellow (
942944 text = (
943- f 'Now waiting until water is mixed with pump, this process will'
944- f ' be monitored automatically...'
945+ 'Now waiting until water is mixed with pump, this process will'
946+ ' be monitored automatically...'
945947 )
946948 )
947949
@@ -965,8 +967,8 @@ def _perform_refilling(
965967 )
966968
967969 print (
968- f '\n =================================================================\n '
969- f '=========================== REFILLING ===========================\n \n '
970+ '\n =================================================================\n '
971+ '=========================== REFILLING ===========================\n \n '
970972 )
971973
972974 refill_to_level : ElectrolyteLevel = (
@@ -1081,8 +1083,8 @@ def _finish_refilling(modbus_client: client.ModbusClient) -> None:
10811083
10821084 _print_yellow (
10831085 text = (
1084- f 'Now waiting until water is mixed with pump, this process will'
1085- f' be monitored automatically...'
1086+ 'Now waiting until water is mixed with pump, this process will be '
1087+ ' monitored automatically...'
10861088 )
10871089 )
10881090
@@ -1110,7 +1112,9 @@ def _wait_electrolyte_level(
11101112
11111113 while time .time () < wait_until :
11121114 if (
1113- electrolyte_level := _electrolyte_level (modbus_client = modbus_client )
1115+ electrolyte_level := _electrolyte_level (
1116+ modbus_client = modbus_client
1117+ )
11141118 ) is expected_level :
11151119 break
11161120
@@ -1195,8 +1199,8 @@ def _check_water_pipe_connection(
11951199 else :
11961200 _print_yellow (
11971201 text = (
1198- f'Water inlet pressure { actual_water_inlet_pressure } is not '
1199- f' in allowed bounds ({ min_pressure } , { max_pressure } )'
1202+ f'Water inlet pressure { actual_water_inlet_pressure } is'
1203+ f' not in allowed bounds ({ min_pressure } , { max_pressure } )'
12001204 )
12011205 )
12021206
@@ -1233,8 +1237,8 @@ def _check_water_pipe_connection(
12331237
12341238 _wait_confirmation (
12351239 prompt = (
1236- f'Problems with water pipe detected.\n Please double check water '
1237- f' pipe, type { INPUT_CONFIRMATION } and press Enter when'
1240+ f'Problems with water pipe detected.\n Please double check'
1241+ f' water pipe, type { INPUT_CONFIRMATION } and press Enter when'
12381242 f' ready:\n '
12391243 )
12401244 )
@@ -1285,8 +1289,9 @@ def _run_maintenance_21(
12851289
12861290 case _:
12871291 raise MaintenanceModeException (
1288- f'Got unexpected refilling state { actual_refilling_state .name } ,'
1289- f' please contact Enapter customer support'
1292+ f'Got unexpected refilling state'
1293+ f' { actual_refilling_state .name } , please contact Enapter'
1294+ f' customer support'
12901295 )
12911296
12921297 if draining_required :
@@ -1336,8 +1341,9 @@ def _run_maintenance_4x(
13361341
13371342 case _:
13381343 raise MaintenanceModeException (
1339- f'Got unexpected refilling state { actual_refilling_state .name } ,'
1340- f' please contact Enapter customer support'
1344+ f'Got unexpected refilling state'
1345+ f' { actual_refilling_state .name } , please contact Enapter'
1346+ f' customer support'
13411347 )
13421348
13431349 if draining_required :
@@ -1456,13 +1462,13 @@ def main() -> None:
14561462 'WARNING! Please read carefully!\n This script turns'
14571463 f' Maintenance mode on.\n Maintenance mode requires manual'
14581464 f' actions with electrolyser such as electrolyte draining,'
1459- f' flushing (for EL4.x) and refilling.\n If you fill electrolyte '
1460- f' for the first time, only refilling is required.\n If at some '
1461- f' step electrolyte level is reported incorrectly, it may '
1462- f' indicate hardware problems.\n In this case terminate script '
1463- f' with Ctrl+C and contact Enapter customer support.\n Script '
1464- f' will be terminated anyway if draining/refilling is not '
1465- f' complete during'
1465+ f' flushing (for EL4.x) and refilling.\n If you fill'
1466+ f' electrolyte for the first time, only refilling is required.'
1467+ f'\n If at some step electrolyte level is reported incorrectly,'
1468+ f' it may indicate hardware problems.\n In this case terminate'
1469+ f' script with Ctrl+C and contact Enapter customer support.\n '
1470+ f'Script will be terminated anyway if draining/refilling is'
1471+ f' not complete during'
14661472 f' { DRAINING_TIMEOUT // 60 } /{ REFILLING_TIMEOUT // 60 } minutes'
14671473 f' correspondingly.\n Type { INPUT_CONFIRMATION } and press Enter'
14681474 f' if you really want to continue. Press Ctrl+С or Enter to'
@@ -1514,13 +1520,15 @@ def main() -> None:
15141520 print (f'Modbus exception: { modbus_client .last_except_as_txt } ' )
15151521
15161522 active_errors : str = (
1517- ', ' .join (_decode_errors (modbus_client = modbus_client )) or
1518- 'No errors'
1523+ ', ' .join (
1524+ _decode_errors (modbus_client = modbus_client )
1525+ ) or 'No errors'
15191526 )
15201527
15211528 active_warnings : str = (
1522- ', ' .join (_decode_warnings (modbus_client = modbus_client )) or
1523- 'No warnings'
1529+ ', ' .join (
1530+ _decode_warnings (modbus_client = modbus_client )
1531+ ) or 'No warnings'
15241532 )
15251533
15261534 _print_red (
0 commit comments