mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Deprecate eddystone temperature integration (#145833)
This commit is contained in:
parent
59ad0268a9
commit
ffdefd1e0f
@ -1 +1,6 @@
|
|||||||
"""The eddystone_temperature component."""
|
"""The eddystone_temperature component."""
|
||||||
|
|
||||||
|
DOMAIN = "eddystone_temperature"
|
||||||
|
CONF_BEACONS = "beacons"
|
||||||
|
CONF_INSTANCE = "instance"
|
||||||
|
CONF_NAMESPACE = "namespace"
|
||||||
|
@ -23,17 +23,18 @@ from homeassistant.const import (
|
|||||||
STATE_UNKNOWN,
|
STATE_UNKNOWN,
|
||||||
UnitOfTemperature,
|
UnitOfTemperature,
|
||||||
)
|
)
|
||||||
from homeassistant.core import Event, HomeAssistant
|
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, Event, 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 CONF_BEACONS, CONF_INSTANCE, CONF_NAMESPACE, DOMAIN
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF_BEACONS = "beacons"
|
|
||||||
CONF_BT_DEVICE_ID = "bt_device_id"
|
CONF_BT_DEVICE_ID = "bt_device_id"
|
||||||
CONF_INSTANCE = "instance"
|
|
||||||
CONF_NAMESPACE = "namespace"
|
|
||||||
|
|
||||||
BEACON_SCHEMA = vol.Schema(
|
BEACON_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
@ -58,6 +59,21 @@ def setup_platform(
|
|||||||
discovery_info: DiscoveryInfoType | None = None,
|
discovery_info: DiscoveryInfoType | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Validate configuration, create devices and start monitoring thread."""
|
"""Validate configuration, create devices and start monitoring thread."""
|
||||||
|
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": "Eddystone",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
bt_device_id: int = config[CONF_BT_DEVICE_ID]
|
bt_device_id: int = config[CONF_BT_DEVICE_ID]
|
||||||
|
|
||||||
beacons: dict[str, dict[str, str]] = config[CONF_BEACONS]
|
beacons: dict[str, dict[str, str]] = config[CONF_BEACONS]
|
||||||
|
3
requirements_test_all.txt
generated
3
requirements_test_all.txt
generated
@ -533,6 +533,9 @@ babel==2.15.0
|
|||||||
# homeassistant.components.homekit
|
# homeassistant.components.homekit
|
||||||
base36==0.1.1
|
base36==0.1.1
|
||||||
|
|
||||||
|
# homeassistant.components.eddystone_temperature
|
||||||
|
# beacontools[scan]==2.1.0
|
||||||
|
|
||||||
# homeassistant.components.scrape
|
# homeassistant.components.scrape
|
||||||
beautifulsoup4==4.13.3
|
beautifulsoup4==4.13.3
|
||||||
|
|
||||||
|
1
tests/components/eddystone_temperature/__init__.py
Normal file
1
tests/components/eddystone_temperature/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
"""Tests for eddystone temperature."""
|
45
tests/components/eddystone_temperature/test_sensor.py
Normal file
45
tests/components/eddystone_temperature/test_sensor.py
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
"""Tests for eddystone temperature."""
|
||||||
|
|
||||||
|
from unittest.mock import Mock, patch
|
||||||
|
|
||||||
|
from homeassistant.components.eddystone_temperature import (
|
||||||
|
CONF_BEACONS,
|
||||||
|
CONF_INSTANCE,
|
||||||
|
CONF_NAMESPACE,
|
||||||
|
DOMAIN,
|
||||||
|
)
|
||||||
|
from homeassistant.components.sensor 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", beacontools=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: DOMAIN,
|
||||||
|
CONF_BEACONS: {
|
||||||
|
"living_room": {
|
||||||
|
CONF_NAMESPACE: "112233445566778899AA",
|
||||||
|
CONF_INSTANCE: "000000000001",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
assert (
|
||||||
|
HOMEASSISTANT_DOMAIN,
|
||||||
|
f"deprecated_system_packages_yaml_integration_{DOMAIN}",
|
||||||
|
) in issue_registry.issues
|
Loading…
x
Reference in New Issue
Block a user