From 1ecf3aba032456075e491d3ad450124d6804dccc Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 1 Oct 2026 20:24:11 -0400 Subject: [PATCH] fix(display): narrow the WiFi status before reading expires_at (#715) Narrow the WiFi status before reading expires_at (mypy Optional index; behaviour unchanged). 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 a22ec555..6ae459a3 100644 --- a/src/display_controller.py +++ b/src/display_controller.py @@ -2522,8 +2522,10 @@ class DisplayController: 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