Skip to content

Commit 7f1d7ed

Browse files
committed
fix whooplite cannot detect at old version
1 parent b0c8feb commit 7f1d7ed

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def switch_version_action(self):
164164
def switch_vtx_callback(self, event):
165165
self.vtx_index_select = self.target_combobox.current()
166166
self.vtx_name_select = self.target_combobox['value'][self.vtx_index_select]
167-
if self.vtx_index_select != 0:
167+
if self.vtx_index_select != 0 and self.vtx_index_select <= len(Download.vtx_id_list):
168168
ch341.vtx_id = Download.vtx_id_list[self.vtx_name_select]
169169
self.reset_fw_state()
170170

@@ -175,7 +175,8 @@ def switch_target_action(self):
175175
def load_firmware_online_callback(event):
176176
global my_gui
177177
if my_gui.vtx_index_select != 0 and my_gui.ver_index_select != 0:
178-
Download.downloadLink = Download.firmware_link_list[my_gui.ver_name_select][my_gui.vtx_name_select]
178+
Download.downloadLink = Download.firmware_link_list[
179+
my_gui.ver_name_select][my_gui.vtx_name_select]
179180
Download.localTemp = "./Data/Temp/fw.zip"
180181
Download.downloadCommand = 2
181182
my_gui.downloadCommand = 2
@@ -371,7 +372,8 @@ def update_connection_state(self):
371372
if vtx_id_list[i] == ch341.vtx_id:
372373
# print()
373374
# print("Current vtx is", i)
374-
for j in range(0, len(vtx_id_list) + 1):
375+
for j in range(0, len(Download.vtx_name_list[self.ver_index_select])):
376+
print(j, self.target_combobox['value'][j])
375377
if self.target_combobox['value'][j] == i:
376378
self.target_combobox.current(j)
377379
self.vtx_name_select = i

0 commit comments

Comments
 (0)