Add webhook trigger condition for automations

Per-automation webhook URL with auto-generated 128-bit hex token.
External services (Home Assistant, IFTTT, curl) can POST to
/api/v1/webhooks/{token} with {"action": "activate"|"deactivate"}
to control automation state — no API key required (token is auth).

Backend: WebhookCondition model, engine state tracking with
immediate evaluation, webhook endpoint, schema/route updates.
Frontend: webhook option in condition editor, URL display with
copy button, card badge, i18n for en/ru/zh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 18:28:31 +03:00
parent 01104acad1
commit aafcf83896
12 changed files with 221 additions and 9 deletions
@@ -270,3 +270,34 @@
color: var(--text-muted);
text-align: center;
}
/* Webhook URL row */
.webhook-url-row {
display: flex;
gap: 6px;
align-items: center;
}
.webhook-url-row input {
flex: 1;
padding: 6px 8px;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--bg-color);
color: var(--text-color);
font-size: 0.8rem;
font-family: monospace;
}
.btn-webhook-copy {
white-space: nowrap;
padding: 6px 12px !important;
font-size: 0.8rem !important;
}
.webhook-save-hint {
color: var(--text-muted);
font-size: 0.85rem;
font-style: italic;
margin: 4px 0 0;
}