Feat: notification queue — buffer rapid /notify calls, play sequentially

When multiple /notify calls arrive in quick succession, they now queue up
and display one at a time rather than clobbering each other. Each notification
plays for its full duration before the next is promoted.

- /notify returns `queued: true` and `notify_queue_size` when buffered
- Cleanup thread auto-advances the queue when the playing notification expires
- /clear on the playing notification promotes the next immediately
- /clear on a queued (not-yet-playing) notification removes it from the queue
- /clear-all also drains the queue
- Status response includes `notify_queue_size` for frontend awareness

Bump to v2.3.3. Update OpenAPI spec, README, TODO.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 23:32:06 -06:00
parent 9f48dec4fc
commit 9a10a6e10c
6 changed files with 100 additions and 25 deletions

View File

@@ -124,7 +124,8 @@ paths:
description: |
Send a temporary notification with optional custom display properties.
Designed for Home Assistant integration. Notifications auto-expire after
the specified duration.
the specified duration. Rapid calls are buffered and played sequentially —
each notification waits for the previous to expire before displaying.
operationId: notify
requestBody:
required: false
@@ -365,7 +366,15 @@ components:
id:
type: string
description: Generated event ID
example: "ha_notify_1704067200000"
example: "notify_1704067200_1"
queued:
type: boolean
description: True if the notification was buffered (another is currently playing)
example: false
notify_queue_size:
type: integer
description: Number of notifications now waiting in the queue
example: 0
current_state:
$ref: "#/components/schemas/Status"
@@ -424,6 +433,10 @@ components:
type: array
items:
$ref: "#/components/schemas/ActiveEvent"
notify_queue_size:
type: integer
description: Number of notifications waiting in the queue
example: 0
last_updated:
type: string
format: date-time