Deprecate decora integration (#145807)

This commit is contained in:
Robert Resch 2025-05-28 23:54:48 +02:00 committed by GitHub
parent 32c2f47ab5
commit 8fd9e2046e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 62 additions and 0 deletions

View File

@ -1 +1,3 @@
"""The decora component."""
DOMAIN = "decora"

View File

@ -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 = {}

View File

@ -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

View File

@ -0,0 +1 @@
"""Decora component tests."""

View 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