feat(foreground): foreground process sensors + translation key migration

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>
This commit is contained in:
2026-05-18 03:13:23 +03:00
parent ab0585278c
commit 9d277276b8
14 changed files with 463 additions and 32 deletions
@@ -76,7 +76,7 @@ class _DisplayNumberBase(CoordinatorEntity[DisplayCoordinator], NumberEntity):
class DisplayBrightnessNumber(_DisplayNumberBase):
"""Number entity for controlling display brightness."""
_attr_name = "Brightness"
_attr_translation_key = "brightness"
_attr_icon = "mdi:brightness-6"
def __init__(
@@ -106,7 +106,7 @@ class DisplayBrightnessNumber(_DisplayNumberBase):
class DisplayContrastNumber(_DisplayNumberBase):
"""Number entity for controlling DDC/CI display contrast."""
_attr_name = "Contrast"
_attr_translation_key = "contrast"
_attr_icon = "mdi:contrast-circle"
def __init__(