Remove screen override timeout to allow drawing to persist indefinitely

This commit is contained in:
Adolfo Reyna
2026-06-01 14:13:38 -04:00
parent 8302db03db
commit f443da0352
2 changed files with 1 additions and 10 deletions
-5
View File
@@ -103,11 +103,6 @@ def main():
# A. Handle non-blocking MCP client connection updates # A. Handle non-blocking MCP client connection updates
mcp.update() mcp.update()
# B. Check if custom draw text override has expired
if mcp.override_active and time.ticks_diff(now, mcp.override_timeout) > 0:
print("MCP Screen override expired. Returning to status dashboard...")
mcp.override_active = False
force_dashboard_redraw = True
# C. Draw local dashboard (if not overridden by MCP draw text commands) # C. Draw local dashboard (if not overridden by MCP draw text commands)
if not mcp.override_active: if not mcp.override_active:
-4
View File
@@ -16,7 +16,6 @@ class MCPServer:
self.sock = None self.sock = None
self.active_led_mode = "off" # static, breath, rainbow, off self.active_led_mode = "off" # static, breath, rainbow, off
self.override_active = False self.override_active = False
self.override_timeout = 0
def start(self, port=80): def start(self, port=80):
"""Starts the TCP server non-blockingly.""" """Starts the TCP server non-blockingly."""
@@ -276,7 +275,6 @@ class MCPServer:
"""Executes hardware actions depending on the called tool name.""" """Executes hardware actions depending on the called tool name."""
if name == "clear_screen": if name == "clear_screen":
self.override_active = True self.override_active = True
self.override_timeout = time.ticks_ms() + 30000 # 30-sec override
color = int(args.get("color", 0)) color = int(args.get("color", 0))
self.display.clear(color) self.display.clear(color)
self.display.show() self.display.show()
@@ -284,7 +282,6 @@ class MCPServer:
elif name == "draw_text": elif name == "draw_text":
self.override_active = True self.override_active = True
self.override_timeout = time.ticks_ms() + 30000 # 30-sec override
text = str(args.get("text", "")) text = str(args.get("text", ""))
x = int(args.get("x", 10)) x = int(args.get("x", 10))
y = int(args.get("y", 10)) y = int(args.get("y", 10))
@@ -343,7 +340,6 @@ class MCPServer:
elif name == "draw_image": elif name == "draw_image":
self.override_active = True self.override_active = True
self.override_timeout = time.ticks_ms() + 30000 # 30-sec override
pbm_b64 = args.get("pbm_base64") pbm_b64 = args.get("pbm_base64")
x = int(args.get("x", 0)) x = int(args.get("x", 0))