mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Deprecate decora integration (#145807)
This commit is contained in:
parent
32c2f47ab5
commit
8fd9e2046e
@ -1 +1,3 @@
|
||||
"""The decora component."""
|
||||
|
||||
DOMAIN = "decora"
|
||||
|
@ -21,7 +21,11 @@ from homeassistant.components.light import (
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_DEVICES, CONF_NAME
|
||||
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
|
||||
|
||||
from . import DOMAIN
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -90,6 +94,21 @@ def setup_platform(
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up an Decora switch."""
|
||||
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": "Leviton Decora",
|
||||
},
|
||||
)
|
||||
|
||||
lights = []
|
||||
for address, device_config in config[CONF_DEVICES].items():
|
||||
device = {}
|
||||
|
6
requirements_test_all.txt
generated
6
requirements_test_all.txt
generated
@ -561,6 +561,9 @@ bluecurrent-api==1.2.3
|
||||
# homeassistant.components.bluemaestro
|
||||
bluemaestro-ble==0.4.1
|
||||
|
||||
# homeassistant.components.decora
|
||||
# bluepy==1.3.0
|
||||
|
||||
# homeassistant.components.bluetooth
|
||||
bluetooth-adapters==0.21.4
|
||||
|
||||
@ -655,6 +658,9 @@ dbus-fast==2.43.0
|
||||
# homeassistant.components.debugpy
|
||||
debugpy==1.8.14
|
||||
|
||||
# homeassistant.components.decora
|
||||
# decora==0.6
|
||||
|
||||
# homeassistant.components.ecovacs
|
||||
deebot-client==13.2.1
|
||||
|
||||
|
1
tests/components/decora/__init__.py
Normal file
1
tests/components/decora/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
"""Decora component tests."""
|
34
tests/components/decora/test_light.py
Normal file
34
tests/components/decora/test_light.py
Normal file
@ -0,0 +1,34 @@
|
||||
"""Decora component tests."""
|
||||
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from homeassistant.components.decora import DOMAIN as DECORA_DOMAIN
|
||||
from homeassistant.components.light import DOMAIN as PLATFORM_DOMAIN
|
||||
from homeassistant.const import CONF_PLATFORM
|
||||
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", {"bluepy": Mock(), "bluepy.btle": Mock(), "decora": Mock()})
|
||||
async def test_repair_issue_is_created(
|
||||
hass: HomeAssistant,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
) -> None:
|
||||
"""Test repair issue is created."""
|
||||
assert await async_setup_component(
|
||||
hass,
|
||||
PLATFORM_DOMAIN,
|
||||
{
|
||||
PLATFORM_DOMAIN: [
|
||||
{
|
||||
CONF_PLATFORM: DECORA_DOMAIN,
|
||||
}
|
||||
],
|
||||
},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
assert (
|
||||
HOMEASSISTANT_DOMAIN,
|
||||
f"deprecated_system_packages_yaml_integration_{DECORA_DOMAIN}",
|
||||
) in issue_registry.issues
|
Loading…
x
Reference in New Issue
Block a user