Upd: limit load_rows interval to 1 second & not load at first iteration

This commit is contained in:
Hengyu 2023-07-01 23:06:46 +08:00
parent c0c3218389
commit 8c38c05696

View File

@ -207,12 +207,20 @@ class DraggableList:
logger.info(f'Select row: {row}')
skip_first_screenshot = True
interval = Timer(5)
skip_first_load_rows = True
load_rows_interval = Timer(1)
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
else:
main.device.screenshot()
self.load_rows(main=main)
if skip_first_load_rows:
skip_first_load_rows = False
else:
if load_rows_interval.reached():
self.load_rows(main=main)
load_rows_interval.reset()
button = self.keyword2button(row)
if not button: