Rename picture-targets to output-targets across entire codebase

Rename all Python modules, classes, API endpoints, config keys, frontend
fetch URLs, and Home Assistant integration URLs from picture-targets to
output-targets. Store loads both new and legacy JSON keys for backward
compatibility with existing data files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 10:55:36 +03:00
parent 5b4813368b
commit 353a1c2d85
37 changed files with 243 additions and 244 deletions

View File

@@ -61,7 +61,7 @@ async def validate_server(
headers = {"Authorization": f"Bearer {api_key}"}
try:
async with session.get(
f"{server_url}/api/v1/picture-targets",
f"{server_url}/api/v1/output-targets",
headers=headers,
timeout=timeout,
) as resp:

View File

@@ -146,9 +146,9 @@ class WLEDScreenControllerCoordinator(DataUpdateCoordinator):
self.server_version = "unknown"
async def _fetch_targets(self) -> list[dict[str, Any]]:
"""Fetch all picture targets."""
"""Fetch all output targets."""
async with self.session.get(
f"{self.server_url}/api/v1/picture-targets",
f"{self.server_url}/api/v1/output-targets",
headers=self._auth_headers,
timeout=aiohttp.ClientTimeout(total=DEFAULT_TIMEOUT),
) as resp:
@@ -159,7 +159,7 @@ class WLEDScreenControllerCoordinator(DataUpdateCoordinator):
async def _fetch_target_state(self, target_id: str) -> dict[str, Any]:
"""Fetch target processing state."""
async with self.session.get(
f"{self.server_url}/api/v1/picture-targets/{target_id}/state",
f"{self.server_url}/api/v1/output-targets/{target_id}/state",
headers=self._auth_headers,
timeout=aiohttp.ClientTimeout(total=DEFAULT_TIMEOUT),
) as resp:
@@ -169,7 +169,7 @@ class WLEDScreenControllerCoordinator(DataUpdateCoordinator):
async def _fetch_target_metrics(self, target_id: str) -> dict[str, Any]:
"""Fetch target metrics."""
async with self.session.get(
f"{self.server_url}/api/v1/picture-targets/{target_id}/metrics",
f"{self.server_url}/api/v1/output-targets/{target_id}/metrics",
headers=self._auth_headers,
timeout=aiohttp.ClientTimeout(total=DEFAULT_TIMEOUT),
) as resp:
@@ -277,7 +277,7 @@ class WLEDScreenControllerCoordinator(DataUpdateCoordinator):
"""Set brightness for a Key Colors target (0-255 mapped to 0.0-1.0)."""
brightness_float = round(brightness / 255, 4)
async with self.session.put(
f"{self.server_url}/api/v1/picture-targets/{target_id}",
f"{self.server_url}/api/v1/output-targets/{target_id}",
headers={**self._auth_headers, "Content-Type": "application/json"},
json={"key_colors_settings": {"brightness": brightness_float}},
timeout=aiohttp.ClientTimeout(total=DEFAULT_TIMEOUT),
@@ -353,9 +353,9 @@ class WLEDScreenControllerCoordinator(DataUpdateCoordinator):
await self.async_request_refresh()
async def update_target(self, target_id: str, **kwargs: Any) -> None:
"""Update a picture target's fields."""
"""Update a output target's fields."""
async with self.session.put(
f"{self.server_url}/api/v1/picture-targets/{target_id}",
f"{self.server_url}/api/v1/output-targets/{target_id}",
headers={**self._auth_headers, "Content-Type": "application/json"},
json=kwargs,
timeout=aiohttp.ClientTimeout(total=DEFAULT_TIMEOUT),
@@ -372,7 +372,7 @@ class WLEDScreenControllerCoordinator(DataUpdateCoordinator):
async def start_processing(self, target_id: str) -> None:
"""Start processing for a target."""
async with self.session.post(
f"{self.server_url}/api/v1/picture-targets/{target_id}/start",
f"{self.server_url}/api/v1/output-targets/{target_id}/start",
headers=self._auth_headers,
timeout=aiohttp.ClientTimeout(total=DEFAULT_TIMEOUT),
) as resp:
@@ -390,7 +390,7 @@ class WLEDScreenControllerCoordinator(DataUpdateCoordinator):
async def stop_processing(self, target_id: str) -> None:
"""Stop processing for a target."""
async with self.session.post(
f"{self.server_url}/api/v1/picture-targets/{target_id}/stop",
f"{self.server_url}/api/v1/output-targets/{target_id}/stop",
headers=self._auth_headers,
timeout=aiohttp.ClientTimeout(total=DEFAULT_TIMEOUT),
) as resp:

View File

@@ -40,7 +40,7 @@ class KeyColorsWebSocketManager:
ws_base = self._server_url.replace("http://", "ws://").replace(
"https://", "wss://"
)
return f"{ws_base}/api/v1/picture-targets/{target_id}/ws?token={self._api_key}"
return f"{ws_base}/api/v1/output-targets/{target_id}/ws?token={self._api_key}"
async def start_listening(self, target_id: str) -> None:
"""Start WebSocket connection for a target."""