Deprecate snips integration (#145784)

This commit is contained in:
Robert Resch 2025-05-31 20:00:34 +02:00 committed by GitHub
parent 0c0a2403e5
commit cabf7860b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 5 deletions

View File

@ -7,8 +7,13 @@ import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.core import (
DOMAIN as HOMEASSISTANT_DOMAIN,
HomeAssistant,
ServiceCall,
)
from homeassistant.helpers import config_validation as cv, intent
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
from homeassistant.helpers.typing import ConfigType
DOMAIN = "snips"
@ -91,6 +96,20 @@ SERVICE_SCHEMA_FEEDBACK = vol.Schema(
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Activate Snips component."""
async_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": "Snips",
},
)
# Make sure MQTT integration is enabled and the client is available
if not await mqtt.async_wait_for_mqtt_client(hass):

View File

@ -7,7 +7,8 @@ import pytest
import voluptuous as vol
from homeassistant.components import snips
from homeassistant.core import HomeAssistant
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.helpers.intent import ServiceIntentHandler, async_register
from homeassistant.setup import async_setup_component
@ -15,9 +16,13 @@ from tests.common import async_fire_mqtt_message, async_mock_intent, async_mock_
from tests.typing import MqttMockHAClient
async def test_snips_config(hass: HomeAssistant, mqtt_mock: MqttMockHAClient) -> None:
async def test_snips_config(
hass: HomeAssistant,
mqtt_mock: MqttMockHAClient,
issue_registry: ir.IssueRegistry,
) -> None:
"""Test Snips Config."""
result = await async_setup_component(
assert await async_setup_component(
hass,
"snips",
{
@ -28,7 +33,10 @@ async def test_snips_config(hass: HomeAssistant, mqtt_mock: MqttMockHAClient) ->
}
},
)
assert result
assert (
HOMEASSISTANT_DOMAIN,
f"deprecated_system_packages_yaml_integration_{snips.DOMAIN}",
) in issue_registry.issues
async def test_snips_no_mqtt(