From 2d9bab20767ca5c6f605f1a87bb373084f6a8b54 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 1 Oct 2026 18:35:34 -0400 Subject: [PATCH] fix(display): narrow the WiFi status before reading expires_at `bool(status) and status['expires_at']` doesn't narrow the Optional for mypy, which flagged the index (one of display_controller.py's errors; the file isn't on the ratchet, so CI didn't see it). Return early on a missing status instead. Same behaviour; mypy 1.20.2 on the file goes 39 -> 38. Co-Authored-By: Claude Opus 5.5 --- src/display_controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/display_controller.py b/src/display_controller.py index fec827028..6c935d994 100644 --- a/src/display_controller.py +++ b/src/display_controller.py @@ -2521,8 +2521,10 @@ def _wifi_notice_pending(self) -> bool: if self.on_demand_active: return False status = self._check_wifi_status_message() + if not status: + return False # The 1 s throttle can hand back a result that has expired since. - return bool(status) and time.time() < status['expires_at'] + return time.time() < float(status['expires_at']) def _resolve_active_mode(self): """The mode this pass shows: the on-demand session's current mode