@@ -23,7 +23,7 @@ def enter_word(
23
23
if debug .layout_type is LayoutType .Delizia and not is_slip39 and len (word ) > 4 :
24
24
# T3T1 (delizia) BIP39 keyboard allows to "confirm" only if the word is fully written, you need to click the word to auto-complete
25
25
debug .click (buttons .CONFIRM_WORD )
26
- return debug .click (buttons .CONFIRM_WORD )
26
+ return debug .click (buttons .CONFIRM_WORD , return_layout = True )
27
27
elif debug .layout_type is LayoutType .Caesar :
28
28
letter_index = 0
29
29
layout = debug .read_layout ()
@@ -32,16 +32,16 @@ def enter_word(
32
32
while layout .find_values_by_key ("letter_choices" ):
33
33
letter = word [letter_index ]
34
34
while not layout .get_middle_choice () == letter :
35
- layout = debug .press_right ()
35
+ layout = debug .press_right (return_layout = True )
36
36
37
- layout = debug .press_middle ()
37
+ layout = debug .press_middle (return_layout = True )
38
38
letter_index += 1
39
39
40
40
# Word choices
41
41
while not layout .get_middle_choice () == word :
42
- layout = debug .press_right ()
42
+ layout = debug .press_right (return_layout = True )
43
43
44
- return debug .press_middle ()
44
+ return debug .press_middle (return_layout = True )
45
45
else :
46
46
raise ValueError ("Unknown model" )
47
47
@@ -78,15 +78,15 @@ def select_bolt() -> "LayoutContent":
78
78
coords = coords_map .get (num_of_words )
79
79
if coords is None :
80
80
raise ValueError ("Invalid num_of_words" )
81
- return debug .click (coords )
81
+ return debug .click (coords , return_layout = True )
82
82
83
83
def select_caesar () -> "LayoutContent" :
84
84
# navigate to the number and confirm it
85
85
word_options = (20 , 33 ) if unlock_repeated_backup else (12 , 18 , 20 , 24 , 33 )
86
86
index = word_options .index (num_of_words )
87
87
for _ in range (index ):
88
88
debug .press_right ()
89
- return debug .press_middle ()
89
+ return debug .press_middle (return_layout = True )
90
90
91
91
def select_delizia () -> "LayoutContent" :
92
92
# click the button from ValuePad
@@ -103,17 +103,17 @@ def select_delizia() -> "LayoutContent":
103
103
coords = coords_map .get (num_of_words )
104
104
if coords is None :
105
105
raise ValueError ("Invalid num_of_words" )
106
- return debug .click (coords )
106
+ return debug .click (coords , return_layout = True )
107
107
108
108
if debug .layout_type is LayoutType .Bolt :
109
109
assert debug .read_layout ().text_content () == TR .recovery__num_of_words
110
- layout = select_bolt ()
110
+ layout = select_bolt (return_layout = True )
111
111
elif debug .layout_type is LayoutType .Caesar :
112
- layout = debug .press_right ()
112
+ layout = debug .press_right (return_layout = True )
113
113
assert layout .title () == TR .word_count__title
114
- layout = select_caesar ()
114
+ layout = select_caesar (return_layout = True )
115
115
elif debug .layout_type is LayoutType .Delizia :
116
- layout = select_delizia ()
116
+ layout = select_delizia (return_layout = True )
117
117
else :
118
118
raise ValueError ("Unknown model" )
119
119
@@ -150,9 +150,9 @@ def enter_share(
150
150
assert TR .translate (before_title ) in debug .read_layout ().title ()
151
151
layout = debug .read_layout ()
152
152
for _ in range (layout .page_count ()):
153
- layout = debug .press_right ()
153
+ layout = debug .press_right (return_layout = True )
154
154
elif debug .layout_type is LayoutType .Delizia :
155
- layout = debug .swipe_up ()
155
+ layout = debug .swipe_up (return_layout = True )
156
156
else :
157
157
assert TR .translate (before_title ) in debug .read_layout ().title ()
158
158
layout = debug .click (buttons .OK )
@@ -236,13 +236,13 @@ def enter_seed_previous_correct(
236
236
layout = debug .read_layout ()
237
237
238
238
while layout .get_middle_choice () not in DELETE_BTNS :
239
- layout = debug .press_right ()
240
- layout = debug .press_middle ()
239
+ layout = debug .press_right (return_layout = True )
240
+ layout = debug .press_middle (return_layout = True )
241
241
242
242
for _ in range (len (bad_word )):
243
243
while layout .get_middle_choice () not in DELETE_BTNS :
244
- layout = debug .press_left ()
245
- layout = debug .press_middle ()
244
+ layout = debug .press_left (return_layout = True )
245
+ layout = debug .press_middle (return_layout = True )
246
246
elif debug .layout_type is LayoutType .Delizia :
247
247
debug .click (buttons .RECOVERY_DELETE ) # Top-left
248
248
for _ in range (len (bad_word )):
0 commit comments