8000 Deprecate lirc integration by edenhaus · Pull Request #145797 · home-assistant/core · GitHub
[go: up one dir, main page]

Skip to content

Deprecate lirc integration #145797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion homeassistant/components/lirc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
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__)
Expand All @@ -26,6 +27,20 @@

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.
Expand Down
3 changes: 3 additions & 0 deletions requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/components/lirc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""LIRC tests."""
31 changes: 31 additions & 0 deletions tests/components/lirc/test_init.py
Original file line number Diff line number Diff line change
@@ -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
0