Revert "Deprecate hddtemp" (#148482)

This commit is contained in:
Robert Resch 2025-07-09 13:53:15 +02:00 committed by Franck Nijhof
parent b6d316c8f2
commit 00e2a177a5
No known key found for this signature in database
GPG Key ID: AB33ADACE7101952
3 changed files with 3 additions and 40 deletions

View File

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

View File

@ -22,14 +22,11 @@ from homeassistant.const import (
CONF_PORT, CONF_PORT,
UnitOfTemperature, UnitOfTemperature,
) )
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import DOMAIN
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
ATTR_DEVICE = "device" ATTR_DEVICE = "device"
@ -59,21 +56,6 @@ def setup_platform(
discovery_info: DiscoveryInfoType | None = None, discovery_info: DiscoveryInfoType | None = None,
) -> None: ) -> None:
"""Set up the HDDTemp sensor.""" """Set up the HDDTemp sensor."""
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": "hddtemp",
},
)
name = config.get(CONF_NAME) name = config.get(CONF_NAME)
host = config.get(CONF_HOST) host = config.get(CONF_HOST)
port = config.get(CONF_PORT) port = config.get(CONF_PORT)

View File

@ -1,15 +1,12 @@
"""The tests for the hddtemp platform.""" """The tests for the hddtemp platform."""
import socket import socket
from unittest.mock import Mock, patch from unittest.mock import patch
import pytest import pytest
from homeassistant.components.hddtemp import DOMAIN
from homeassistant.components.sensor import DOMAIN as PLATFORM_DOMAIN
from homeassistant.const import UnitOfTemperature from homeassistant.const import UnitOfTemperature
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.setup import async_setup_component from homeassistant.setup import async_setup_component
VALID_CONFIG_MINIMAL = {"sensor": {"platform": "hddtemp"}} VALID_CONFIG_MINIMAL = {"sensor": {"platform": "hddtemp"}}
@ -195,17 +192,3 @@ async def test_hddtemp_host_unreachable(hass: HomeAssistant, telnetmock) -> None
assert await async_setup_component(hass, "sensor", VALID_CONFIG_HOST_UNREACHABLE) assert await async_setup_component(hass, "sensor", VALID_CONFIG_HOST_UNREACHABLE)
await hass.async_block_till_done() await hass.async_block_till_done()
assert len(hass.states.async_all()) == 0 assert len(hass.states.async_all()) == 0
@patch.dict("sys.modules", gsp=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, VALID_CONFIG_MINIMAL)
await hass.async_block_till_done()
assert (
HOMEASSISTANT_DOMAIN,
f"deprecated_system_packages_yaml_integration_{DOMAIN}",
) in issue_registry.issues