Deprecate GStreamer integration (#145768)

This commit is contained in:
Robert Resch 2025-05-28 11:16:08 +02:00 committed by GitHub
parent c1676570da
commit bb52058920
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 58 additions and 2 deletions

View File

@ -1 +1,3 @@
"""The gstreamer component."""
DOMAIN = "gstreamer"

View File

@ -19,16 +19,18 @@ from homeassistant.components.media_player import (
async_process_play_media_url,
)
from homeassistant.const import CONF_NAME, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import DOMAIN
_LOGGER = logging.getLogger(__name__)
CONF_PIPELINE = "pipeline"
DOMAIN = "gstreamer"
PLATFORM_SCHEMA = MEDIA_PLAYER_PLATFORM_SCHEMA.extend(
{vol.Optional(CONF_NAME): cv.string, vol.Optional(CONF_PIPELINE): cv.string}
@ -48,6 +50,20 @@ def setup_platform(
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the Gstreamer platform."""
create_issue(
hass,
HOMEASSISTANT_DOMAIN,
f"deprecated_system_packages_yaml_integration_{DOMAIN}",
breaks_in_ha_version="2025.12.0",
is_fixable=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_system_packages_yaml_integration",
translation_placeholders={
"domain": DOMAIN,
"integration_title": "GStreamer",
},
)
name = config.get(CONF_NAME)
pipeline = config.get(CONF_PIPELINE)

View File

@ -945,6 +945,9 @@ growattServer==1.6.0
# homeassistant.components.google_sheets
gspread==5.5.0
# homeassistant.components.gstreamer
gstreamer-player==1.1.2
# homeassistant.components.profiler
guppy3==3.1.5

View File

@ -0,0 +1 @@
"""Gstreamer tests."""

View File

@ -0,0 +1,34 @@
"""Tests for the Gstreamer platform."""
from unittest.mock import Mock, patch
from homeassistant.components.gstreamer import DOMAIN as GSTREAMER_DOMAIN
from homeassistant.components.media_player import DOMAIN as PLATFORM_DOMAIN
from homeassistant.const import CONF_PLATFORM
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.setup import async_setup_component
@patch.dict("sys.modules", gsp=Mock())
async def test_repair_issue_is_created(
hass: HomeAssistant,
issue_registry: ir.IssueRegistry,
) -> None:
"""Test repair issue is created."""
assert await async_setup_component(
hass,
PLATFORM_DOMAIN,
{
PLATFORM_DOMAIN: [
{
CONF_PLATFORM: GSTREAMER_DOMAIN,
}
],
},
)
await hass.async_block_till_done()
assert (
HOMEASSISTANT_DOMAIN,
f"deprecated_system_packages_yaml_integration_{GSTREAMER_DOMAIN}",
) in issue_registry.issues