Update for new filenames
This commit is contained in:
parent
c820fb9421
commit
46da0c049b
3 changed files with 15 additions and 6 deletions
|
@ -93,18 +93,26 @@ class FwUpdater:
|
||||||
address, os.path.abspath(local_filename), FLASH))
|
address, os.path.abspath(local_filename), FLASH))
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
def start_fs_update(self, release_name, address):
|
def start_fs_update(self, release_name, address, hw_rev):
|
||||||
|
hw_rev_to_model = {
|
||||||
|
"REV_B_EPD_2_13": "littlefs_8MB",
|
||||||
|
"REV_V8_EPD_2_13": "littlefs_16MB",
|
||||||
|
"REV_A_EPD_2_9": "littlefs_4MB"
|
||||||
|
}
|
||||||
|
|
||||||
# Path to the firmware file
|
# Path to the firmware file
|
||||||
local_filename = f"{get_app_data_folder()}/{release_name}_littlefs.bin"
|
local_filename = f"{get_app_data_folder()}/{release_name}_{hw_rev_to_model.get(hw_rev, "littlefs_4MB")}.bin"
|
||||||
|
|
||||||
self.updatingName = address
|
self.updatingName = address
|
||||||
self.currentlyUpdating = True
|
self.currentlyUpdating = True
|
||||||
|
|
||||||
if self.event_cb is not None:
|
if self.event_cb is not None:
|
||||||
self.event_cb("Starting WebUI update")
|
self.event_cb(f"Starting WebUI update {local_filename}")
|
||||||
|
|
||||||
if os.path.exists(os.path.abspath(local_filename)):
|
if os.path.exists(os.path.abspath(local_filename)):
|
||||||
thread = Thread(target=self.run_fs_update, args=(
|
thread = Thread(target=self.run_fs_update, args=(
|
||||||
address, os.path.abspath(local_filename), SPIFFS))
|
address, os.path.abspath(local_filename), SPIFFS))
|
||||||
thread.start()
|
thread.start()
|
||||||
|
else:
|
||||||
|
if self.event_cb is not None:
|
||||||
|
self.event_cb(f"Firmware file not found: {local_filename}")
|
||||||
|
|
|
@ -80,6 +80,7 @@ class ActionButtonPanel(wx.Panel):
|
||||||
selected_index = self.device_list.GetFirstSelected()
|
selected_index = self.device_list.GetFirstSelected()
|
||||||
if selected_index != -1:
|
if selected_index != -1:
|
||||||
service_name = self.device_list.GetItemText(selected_index, 0)
|
service_name = self.device_list.GetItemText(selected_index, 0)
|
||||||
|
hw_rev = self.device_list.GetItemText(selected_index, 3)
|
||||||
info = self.listener.services.get(service_name)
|
info = self.listener.services.get(service_name)
|
||||||
if self.currentlyUpdating:
|
if self.currentlyUpdating:
|
||||||
wx.MessageBox("Please wait, already updating",
|
wx.MessageBox("Please wait, already updating",
|
||||||
|
@ -89,7 +90,7 @@ class ActionButtonPanel(wx.Panel):
|
||||||
if info:
|
if info:
|
||||||
address = info.parsed_addresses(
|
address = info.parsed_addresses(
|
||||||
)[0] if info.parsed_addresses() else "N/A"
|
)[0] if info.parsed_addresses() else "N/A"
|
||||||
self.parent_frame.fw_updater.start_fs_update(self.parent_frame.releaseChecker.release_name, address)
|
self.parent_frame.fw_updater.start_fs_update(self.parent_frame.releaseChecker.release_name, address, hw_rev)
|
||||||
else:
|
else:
|
||||||
wx.MessageBox(
|
wx.MessageBox(
|
||||||
"No service information available for selected device", "Error", wx.ICON_ERROR)
|
"No service information available for selected device", "Error", wx.ICON_ERROR)
|
||||||
|
|
|
@ -65,7 +65,7 @@ class ReleaseChecker:
|
||||||
"lolin_s3_mini_29epd_firmware.bin",
|
"lolin_s3_mini_29epd_firmware.bin",
|
||||||
"btclock_v8_213epd_firmware.bin",
|
"btclock_v8_213epd_firmware.bin",
|
||||||
"btclock_rev_b_213epd_firmware.bin",
|
"btclock_rev_b_213epd_firmware.bin",
|
||||||
"littlefs.bin"]
|
"littlefs_4MB.bin", "littlefs_8MB.bin", "littlefs_16MB.bin"]
|
||||||
|
|
||||||
asset_urls = [asset['browser_download_url']
|
asset_urls = [asset['browser_download_url']
|
||||||
for asset in latest_release['assets'] if asset['name'] in filenames_to_download]
|
for asset in latest_release['assets'] if asset['name'] in filenames_to_download]
|
||||||
|
|
Loading…
Reference in a new issue