mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Deprecate lirc integration (#145797)
This commit is contained in:
parent
27af2d8ec6
commit
ca567aa7fc
@ -7,8 +7,9 @@ import time
|
||||
import lirc
|
||||
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_START, 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.issue_registry import IssueSeverity, create_issue
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@ -26,6 +27,20 @@ CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
|
||||
|
||||
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the LIRC capability."""
|
||||
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": "LIRC",
|
||||
},
|
||||
)
|
||||
# blocking=True gives unexpected behavior (multiple responses for 1 press)
|
||||
# also by not blocking, we allow hass to shut down the thread gracefully
|
||||
# on exit.
|
||||
|
3
requirements_test_all.txt
generated
3
requirements_test_all.txt
generated
@ -2012,6 +2012,9 @@ python-kasa[speedups]==0.10.2
|
||||
# homeassistant.components.linkplay
|
||||
python-linkplay==0.2.8
|
||||
|
||||
# homeassistant.components.lirc
|
||||
# python-lirc==1.2.3
|
||||
|
||||
# homeassistant.components.matter
|
||||
python-matter-server==7.0.0
|
||||
|
||||
|
1
tests/components/lirc/__init__.py
Normal file
1
tests/components/lirc/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
"""LIRC tests."""
|
31
tests/components/lirc/test_init.py
Normal file
31
tests/components/lirc/test_init.py
Normal file
@ -0,0 +1,31 @@
|
||||
"""Tests for the LIRC."""
|
||||
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
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", lirc=Mock())
|
||||
async def test_repair_issue_is_created(
|
||||
hass: HomeAssistant,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
) -> None:
|
||||
"""Test repair issue is created."""
|
||||
from homeassistant.components.lirc import ( # pylint: disable=import-outside-toplevel
|
||||
DOMAIN as LIRC_DOMAIN,
|
||||
)
|
||||
|
||||
assert await async_setup_component(
|
||||
hass,
|
||||
LIRC_DOMAIN,
|
||||
{
|
||||
LIRC_DOMAIN: {},
|
||||
},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
assert (
|
||||
HOMEASSISTANT_DOMAIN,
|
||||
f"deprecated_system_packages_yaml_integration_{LIRC_DOMAIN}",
|
||||
) in issue_registry.issues
|
Loading…
x
Reference in New Issue
Block a user