Compare commits

...

2 Commits

Author SHA1 Message Date
dw-0
acb3a45018 fix(ui): handle missing or empty local version values and standardize defaults 2026-01-18 14:17:34 +01:00
Théo Gaillard
f951936b20 fix: navigation fallthrough in 'Get MCU ID' (Advanced Menu) (#762)
* fix: corrected back navigation in advanced menu in reference to #761

* ci: add delay after warning when no MCUs are found
2026-01-18 12:16:45 +01:00
3 changed files with 6 additions and 4 deletions

View File

@@ -236,9 +236,11 @@ class KlipperSelectMcuConnectionMenu(BaseMenu):
if len(self.flash_options.mcu_list) < 1:
Logger.print_warn("No MCUs found!")
Logger.print_warn("Make sure they are connected and repeat this step.")
time.sleep(3)
return
# if standalone is True, we only display the MCUs to the user and return
if self.__standalone and len(self.flash_options.mcu_list) > 0:
if self.__standalone:
Logger.print_ok("The following MCUs were found:", prefix=False)
for i, mcu in enumerate(self.flash_options.mcu_list):
print(f" ● MCU #{i}: {Color.CYAN}{mcu}{Color.RST}")

View File

@@ -152,7 +152,7 @@ def symlink_webui_nginx_log(
def get_local_client_version(client: BaseWebClient) -> str | None:
relinfo_file = client.client_dir.joinpath("release_info.json")
version_file = client.client_dir.joinpath(".version")
default = "n/a"
default = "-"
if not client.client_dir.exists():
return default

View File

@@ -257,14 +257,14 @@ class UpdateMenu(BaseMenu):
def _format_local_status(self, local_version, remote_version) -> str:
color = Color.RED
if not local_version:
if not local_version or local_version == '-':
color = Color.RED
elif local_version == remote_version:
color = Color.GREEN
elif local_version != remote_version:
color = Color.YELLOW
return Color.apply(local_version or "-", color)
return str(Color.apply(local_version or '-', color))
def _set_status_data(self, name: str, status_fn: Callable, *args) -> None:
comp_status: ComponentStatus = status_fn(*args)