feat: add chase and gradient flash notification effects with priority queue
Some checks failed
Lint & Test / test (push) Failing after 28s
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:
@@ -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)}"}))
|
||||
|
||||
Reference in New Issue
Block a user