feat(websocket): add WebSocket display backend for browser client

This commit is contained in:
2026-03-15 20:54:03 -07:00
parent 2650f7245e
commit ac1306373d
15 changed files with 1612 additions and 34 deletions

View File

@@ -8,6 +8,17 @@ from engine.events import EventType, StreamEvent
from engine.mic import MicMonitor
from engine.ntfy import NtfyPoller
from engine.scroll import stream
from engine.websocket_display import WebSocketDisplay
def _get_display(config: Config):
"""Get the appropriate display based on config."""
if config.websocket:
ws = WebSocketDisplay(host="0.0.0.0", port=config.websocket_port)
ws.start_server()
ws.start_http_server()
return ws
return None
class StreamController:
@@ -51,7 +62,10 @@ class StreamController:
),
)
stream(items, self.ntfy, self.mic)
display = _get_display(self.config)
stream(items, self.ntfy, self.mic, display)
if display:
display.cleanup()
if self.event_bus:
self.event_bus.publish(