feat: add chase and gradient flash notification effects with priority queue
Some checks failed
Lint & Test / test (push) Failing after 28s

New notification effects:
- Chase: light bounces across strip with Gaussian glow tail
- Gradient flash: bright center fades to edges with exponential decay

Queue priority: notifications with color_override get high priority and
interrupt the current effect.

Also fixes transient preview for notification sources — adds WebSocket
"fire" command so inline preview works without a saved source, plus
auto-fires on preview open so the effect is visible immediately.
This commit is contained in:
2026-03-24 00:00:49 +03:00
parent 9b80076b5b
commit 2c3f08344c
6 changed files with 120 additions and 9 deletions

View File

@@ -507,7 +507,7 @@ async def os_notification_history(_auth: AuthRequired):
# ── Transient Preview WebSocket ────────────────────────────────────────
_PREVIEW_ALLOWED_TYPES = {"static", "gradient", "color_cycle", "effect", "daylight", "candlelight"}
_PREVIEW_ALLOWED_TYPES = {"static", "gradient", "color_cycle", "effect", "daylight", "candlelight", "notification"}
@router.websocket("/api/v1/color-strip-sources/preview/ws")
@@ -648,6 +648,17 @@ async def preview_color_strip_ws(
if msg is not None:
try:
new_config = _json.loads(msg)
# Handle "fire" command for notification streams
if new_config.get("action") == "fire":
from wled_controller.core.processing.notification_stream import NotificationColorStripStream
if isinstance(stream, NotificationColorStripStream):
stream.fire(
app_name=new_config.get("app", ""),
color_override=new_config.get("color"),
)
continue
new_type = new_config.get("source_type")
if new_type not in _PREVIEW_ALLOWED_TYPES:
await websocket.send_text(_json.dumps({"type": "error", "detail": f"source_type must be one of {sorted(_PREVIEW_ALLOWED_TYPES)}"}))