9d277276b8
Adds Home Assistant entities for the foreground-process feature shipped in the media server, plus migrates existing display entities to use HA translation keys (strings.json / translations/*) so per-language UI text flows through the standard locale mechanism. Foreground entities (all share one HA "Foreground" device linked to the hub via via_device): - sensor.foreground_process — process name as state + full payload (pid, exec path, window title, fullscreen flag, monitor, geometry, is_browser, browser_page_title, browser_url, error) as attributes - sensor.window_title, sensor.pid, sensor.foreground_monitor, sensor.process_started (TIMESTAMP device class) - binary_sensor.fullscreen, binary_sensor.minimized Data flow: - ForegroundCoordinator polls GET /api/foreground every 5s (HTTP fallback) - media_player's WebSocket receiver forwards `foreground` / `foreground_update` push frames into the coordinator via apply_websocket_snapshot, so sensors update in near-real-time when WS is connected and fall back to polling otherwise Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
90 lines
2.7 KiB
JSON
90 lines
2.7 KiB
JSON
{
|
|
"config": {
|
|
"step": {
|
|
"user": {
|
|
"title": "Connect to Media Server",
|
|
"description": "Enter the connection details for your Media Server.",
|
|
"data": {
|
|
"host": "Host",
|
|
"port": "Port",
|
|
"token": "API Token",
|
|
"name": "Name",
|
|
"poll_interval": "Poll Interval"
|
|
},
|
|
"data_description": {
|
|
"host": "Hostname or IP address of the Media Server",
|
|
"port": "Port number (default: 8765)",
|
|
"token": "API authentication token from the server configuration. Leave blank if the server runs without authentication.",
|
|
"name": "Display name for this media player",
|
|
"poll_interval": "How often to poll for status updates (seconds)"
|
|
}
|
|
}
|
|
},
|
|
"error": {
|
|
"cannot_connect": "Failed to connect to the Media Server. Please check the host and port.",
|
|
"invalid_auth": "Invalid API token. Please check your token.",
|
|
"unknown": "An unexpected error occurred."
|
|
},
|
|
"abort": {
|
|
"already_configured": "This Media Server is already configured."
|
|
}
|
|
},
|
|
"options": {
|
|
"step": {
|
|
"init": {
|
|
"title": "Options",
|
|
"data": {
|
|
"poll_interval": "Poll Interval"
|
|
},
|
|
"data_description": {
|
|
"poll_interval": "How often to poll for status updates (seconds)"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"entity": {
|
|
"binary_sensor": {
|
|
"primary_display": { "name": "Primary display" },
|
|
"power_control_supported": { "name": "Power control supported" },
|
|
"fullscreen": { "name": "Fullscreen" },
|
|
"minimized": { "name": "Minimized" }
|
|
},
|
|
"sensor": {
|
|
"resolution": { "name": "Resolution" },
|
|
"foreground_process": { "name": "Foreground process" },
|
|
"window_title": { "name": "Window title" },
|
|
"pid": { "name": "PID" },
|
|
"foreground_monitor": { "name": "Monitor" },
|
|
"process_started": { "name": "Process started" }
|
|
},
|
|
"number": {
|
|
"brightness": { "name": "Brightness" },
|
|
"contrast": { "name": "Contrast" }
|
|
},
|
|
"switch": {
|
|
"power": { "name": "Power" }
|
|
},
|
|
"select": {
|
|
"input_source": { "name": "Input source" },
|
|
"color_preset": { "name": "Color preset" },
|
|
"picture_mode": { "name": "Picture mode" }
|
|
}
|
|
},
|
|
"services": {
|
|
"execute_script": {
|
|
"name": "Execute Script",
|
|
"description": "Execute a pre-defined script on the media server.",
|
|
"fields": {
|
|
"script_name": {
|
|
"name": "Script Name",
|
|
"description": "Name of the script to execute (as defined in server config)"
|
|
},
|
|
"args": {
|
|
"name": "Arguments",
|
|
"description": "Optional list of arguments to pass to the script"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|