Add HAOS-Server sync for optional centralized management (Phase 5)
Some checks failed
Validate / Hassfest (push) Has been cancelled

Enable the HAOS integration to optionally connect to the standalone
Immich Watcher server for config sync and event reporting.

Server-side:
- New /api/sync/* endpoints: GET trackers, POST template render,
  POST event report
- API key auth via X-API-Key header (accepts JWT access tokens)

Integration-side:
- New sync.py: ServerSyncClient with graceful error handling
  (all methods return defaults on connection failure)
- Options flow: optional server_url and server_api_key fields
  with connection validation
- Coordinator: fire-and-forget event reporting to server when
  album changes are detected
- Translations: en.json and ru.json updated with new fields

The connection is fully additive -- the integration works identically
without a server URL configured. Server failures never break HA.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 14:10:29 +03:00
parent 2b487707ce
commit ab1c7ac0db
11 changed files with 441 additions and 20 deletions

View File

@@ -80,7 +80,8 @@
"cannot_connect": "Failed to connect to Immich server",
"invalid_auth": "Invalid API key",
"no_albums": "No albums found on the server",
"unknown": "Unexpected error occurred"
"unknown": "Unexpected error occurred",
"server_connect_failed": "Failed to connect to Immich Watcher server"
},
"abort": {
"already_configured": "This Immich server is already configured"
@@ -120,12 +121,16 @@
"data": {
"scan_interval": "Scan interval (seconds)",
"telegram_bot_token": "Telegram Bot Token",
"telegram_cache_ttl": "Telegram Cache TTL (hours)"
"telegram_cache_ttl": "Telegram Cache TTL (hours)",
"server_url": "Watcher Server URL (optional)",
"server_api_key": "Watcher Server API Key (optional)"
},
"data_description": {
"scan_interval": "How often to check for album changes (10-3600 seconds)",
"telegram_bot_token": "Bot token for sending notifications to Telegram",
"telegram_cache_ttl": "How long to cache uploaded file IDs to avoid re-uploading (1-168 hours, default: 48)"
"telegram_cache_ttl": "How long to cache uploaded file IDs to avoid re-uploading (1-168 hours, default: 48)",
"server_url": "URL of the standalone Immich Watcher server for config sync and event reporting (leave empty to disable)",
"server_api_key": "API key (JWT access token) for authenticating with the Watcher server"
}
}
}

View File

@@ -120,12 +120,16 @@
"data": {
"scan_interval": "Интервал сканирования (секунды)",
"telegram_bot_token": "Токен Telegram бота",
"telegram_cache_ttl": "Время жизни кэша Telegram (часы)"
"telegram_cache_ttl": "Время жизни кэша Telegram (часы)",
"server_url": "URL сервера Watcher (необязательно)",
"server_api_key": "API ключ сервера Watcher (необязательно)"
},
"data_description": {
"scan_interval": "Как часто проверять изменения в альбомах (10-3600 секунд)",
"telegram_bot_token": "Токен бота для отправки уведомлений в Telegram",
"telegram_cache_ttl": "Сколько хранить ID загруженных файлов для повторной отправки без загрузки (1-168 часов, по умолчанию: 48)"
"telegram_cache_ttl": "Сколько хранить ID загруженных файлов для повторной отправки без загрузки (1-168 часов, по умолчанию: 48)",
"server_url": "URL автономного сервера Immich Watcher для синхронизации конфигурации и отчётов о событиях (оставьте пустым для отключения)",
"server_api_key": "API ключ (JWT токен) для аутентификации на сервере Watcher"
}
}
}