mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Deprecate keyboard integration (#145805)
This commit is contained in:
parent
59ea6f375a
commit
27af2d8ec6
@ -11,8 +11,9 @@ from homeassistant.const import (
|
||||
SERVICE_VOLUME_MUTE,
|
||||
SERVICE_VOLUME_UP,
|
||||
)
|
||||
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
|
||||
|
||||
DOMAIN = "keyboard"
|
||||
@ -24,6 +25,20 @@ CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
|
||||
|
||||
def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Listen for keyboard events."""
|
||||
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": "Keyboard",
|
||||
},
|
||||
)
|
||||
|
||||
keyboard = PyKeyboard()
|
||||
keyboard.special_key_assignment()
|
||||
|
3
requirements_test_all.txt
generated
3
requirements_test_all.txt
generated
@ -2095,6 +2095,9 @@ pytrydan==0.8.0
|
||||
# homeassistant.components.uptimerobot
|
||||
pyuptimerobot==22.2.0
|
||||
|
||||
# homeassistant.components.keyboard
|
||||
# pyuserinput==0.1.11
|
||||
|
||||
# homeassistant.components.vera
|
||||
pyvera==0.3.15
|
||||
|
||||
|
1
tests/components/keyboard/__init__.py
Normal file
1
tests/components/keyboard/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
"""Keyboard tests."""
|
29
tests/components/keyboard/test_init.py
Normal file
29
tests/components/keyboard/test_init.py
Normal file
@ -0,0 +1,29 @@
|
||||
"""Keyboard tests."""
|
||||
|
||||
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", pykeyboard=Mock())
|
||||
async def test_repair_issue_is_created(
|
||||
hass: HomeAssistant,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
) -> None:
|
||||
"""Test repair issue is created."""
|
||||
from homeassistant.components.keyboard import ( # pylint:disable=import-outside-toplevel
|
||||
DOMAIN as KEYBOARD_DOMAIN,
|
||||
)
|
||||
|
||||
assert await async_setup_component(
|
||||
hass,
|
||||
KEYBOARD_DOMAIN,
|
||||
{KEYBOARD_DOMAIN: {}},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
assert (
|
||||
HOMEASSISTANT_DOMAIN,
|
||||
f"deprecated_system_packages_yaml_integration_{KEYBOARD_DOMAIN}",
|
||||
) in issue_registry.issues
|
Loading…
x
Reference in New Issue
Block a user