mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Deprecate GStreamer integration (#145768)
This commit is contained in:
parent
c1676570da
commit
bb52058920
@ -1 +1,3 @@
|
|||||||
"""The gstreamer component."""
|
"""The gstreamer component."""
|
||||||
|
|
||||||
|
DOMAIN = "gstreamer"
|
||||||
|
@ -19,16 +19,18 @@ from homeassistant.components.media_player import (
|
|||||||
async_process_play_media_url,
|
async_process_play_media_url,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_NAME, EVENT_HOMEASSISTANT_STOP
|
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 import config_validation as cv
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
|
from . import DOMAIN
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF_PIPELINE = "pipeline"
|
CONF_PIPELINE = "pipeline"
|
||||||
|
|
||||||
DOMAIN = "gstreamer"
|
|
||||||
|
|
||||||
PLATFORM_SCHEMA = MEDIA_PLAYER_PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = MEDIA_PLAYER_PLATFORM_SCHEMA.extend(
|
||||||
{vol.Optional(CONF_NAME): cv.string, vol.Optional(CONF_PIPELINE): cv.string}
|
{vol.Optional(CONF_NAME): cv.string, vol.Optional(CONF_PIPELINE): cv.string}
|
||||||
@ -48,6 +50,20 @@ def setup_platform(
|
|||||||
discovery_info: DiscoveryInfoType | None = None,
|
discovery_info: DiscoveryInfoType | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the Gstreamer platform."""
|
"""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)
|
name = config.get(CONF_NAME)
|
||||||
pipeline = config.get(CONF_PIPELINE)
|
pipeline = config.get(CONF_PIPELINE)
|
||||||
|
3
requirements_test_all.txt
generated
3
requirements_test_all.txt
generated
@ -945,6 +945,9 @@ growattServer==1.6.0
|
|||||||
# homeassistant.components.google_sheets
|
# homeassistant.components.google_sheets
|
||||||
gspread==5.5.0
|
gspread==5.5.0
|
||||||
|
|
||||||
|
# homeassistant.components.gstreamer
|
||||||
|
gstreamer-player==1.1.2
|
||||||
|
|
||||||
# homeassistant.components.profiler
|
# homeassistant.components.profiler
|
||||||
guppy3==3.1.5
|
guppy3==3.1.5
|
||||||
|
|
||||||
|
1
tests/components/gstreamer/__init__.py
Normal file
1
tests/components/gstreamer/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
"""Gstreamer tests."""
|
34
tests/components/gstreamer/test_media_player.py
Normal file
34
tests/components/gstreamer/test_media_player.py
Normal 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
|
Loading…
x
Reference in New Issue
Block a user