mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Deprecate snips integration (#145784)
This commit is contained in:
parent
0c0a2403e5
commit
cabf7860b3
@ -7,8 +7,13 @@ import logging
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import mqtt
|
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 import config_validation as cv, intent
|
||||||
|
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
|
||||||
DOMAIN = "snips"
|
DOMAIN = "snips"
|
||||||
@ -91,6 +96,20 @@ SERVICE_SCHEMA_FEEDBACK = vol.Schema(
|
|||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
"""Activate Snips component."""
|
"""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
|
# Make sure MQTT integration is enabled and the client is available
|
||||||
if not await mqtt.async_wait_for_mqtt_client(hass):
|
if not await mqtt.async_wait_for_mqtt_client(hass):
|
||||||
|
@ -7,7 +7,8 @@ import pytest
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import snips
|
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.helpers.intent import ServiceIntentHandler, async_register
|
||||||
from homeassistant.setup import async_setup_component
|
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
|
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."""
|
"""Test Snips Config."""
|
||||||
result = await async_setup_component(
|
assert await async_setup_component(
|
||||||
hass,
|
hass,
|
||||||
"snips",
|
"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(
|
async def test_snips_no_mqtt(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user