Add OS notification listener for Windows toast capture
Polls Windows notifications via winsdk UserNotificationListener API and fires matching notification CSS streams with os_listener=True. Includes history API endpoint for tracking captured notifications. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -570,6 +570,19 @@ async def notify_source(
|
||||
}
|
||||
|
||||
|
||||
@router.get("/api/v1/color-strip-sources/os-notifications/history", tags=["Color Strip Sources"])
|
||||
async def os_notification_history(_auth: AuthRequired):
|
||||
"""Return recent OS notification capture history (newest first)."""
|
||||
from wled_controller.core.processing.os_notification_listener import get_os_notification_listener
|
||||
listener = get_os_notification_listener()
|
||||
if listener is None:
|
||||
return {"available": False, "history": []}
|
||||
return {
|
||||
"available": listener._available,
|
||||
"history": listener.recent_history,
|
||||
}
|
||||
|
||||
|
||||
@router.websocket("/api/v1/color-strip-sources/{source_id}/ws")
|
||||
async def css_api_input_ws(
|
||||
websocket: WebSocket,
|
||||
|
||||
Reference in New Issue
Block a user