Skip to content

Commit de5437f

Browse files
authored
Remove YAML warning for thethingsnetwork after warning for 6 months (#130307)
1 parent c52a893 commit de5437f

File tree

3 files changed

+1
-63
lines changed

3 files changed

+1
-63
lines changed

homeassistant/components/thethingsnetwork/__init__.py

+1-41
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,15 @@
22

33
import logging
44

5-
import voluptuous as vol
6-
75
from homeassistant.config_entries import ConfigEntry
86
from homeassistant.const import CONF_API_KEY, CONF_HOST
97
from homeassistant.core import HomeAssistant
10-
from homeassistant.helpers import issue_registry as ir
11-
import homeassistant.helpers.config_validation as cv
12-
from homeassistant.helpers.typing import ConfigType
138

14-
from .const import CONF_APP_ID, DOMAIN, PLATFORMS, TTN_API_HOST
9+
from .const import DOMAIN, PLATFORMS, TTN_API_HOST
1510
from .coordinator import TTNCoordinator
1611

1712
_LOGGER = logging.getLogger(__name__)
1813

19-
CONFIG_SCHEMA = vol.Schema(
20-
{
21-
# Configuration via yaml not longer supported - keeping to warn about migration
22-
DOMAIN: vol.Schema(
23-
{
24-
vol.Required(CONF_APP_ID): cv.string,
25-
vol.Required("access_key"): cv.string,
26-
}
27-
)
28-
},
29-
extra=vol.ALLOW_EXTRA,
30-
)
31-
32-
33-
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
34-
"""Initialize of The Things Network component."""
35-
36-
if DOMAIN in config:
37-
ir.async_create_issue(
38-
hass,
39-
DOMAIN,
40-
"manual_migration",
41-
breaks_in_ha_version="2024.12.0",
42-
is_fixable=False,
43-
severity=ir.IssueSeverity.ERROR,
44-
translation_key="manual_migration",
45-
translation_placeholders={
46-
"domain": DOMAIN,
47-
"v2_v3_migration_url": "https://www.thethingsnetwork.org/forum/c/v2-to-v3-upgrade/102",
48-
"v2_deprecation_url": "https://www.thethingsnetwork.org/forum/t/the-things-network-v2-is-permanently-shutting-down-completed/50710",
49-
},
50-
)
51-
52-
return True
53-
5414

5515
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
5616
"""Establish connection with The Things Network."""

homeassistant/components/thethingsnetwork/strings.json

-6
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,5 @@
2222
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
2323
"unknown": "[%key:common::config_flow::error::unknown%]"
2424
}
25-
},
26-
"issues": {
27-
"manual_migration": {
28-
"description": "Configuring {domain} using YAML was removed as part of migrating to [The Things Network v3]({v2_v3_migration_url}). [The Things Network v2 has shutted down]({v2_deprecation_url}).\n\nPlease remove the {domain} entry from the configuration.yaml and add re-add the integration using the config_flow",
29-
"title": "The {domain} YAML configuration is not supported"
30-
}
3125
}
3226
}

tests/components/thethingsnetwork/test_init.py

-16
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@
44
from ttn_client import TTNAuthError
55

66
from homeassistant.core import HomeAssistant
7-
from homeassistant.helpers import issue_registry as ir
8-
from homeassistant.setup import async_setup_component
9-
10-
from .conftest import DOMAIN
11-
12-
13-
async def test_error_configuration(
14-
hass: HomeAssistant,
15-
issue_registry: ir.IssueRegistry,
16-
) -> None:
17-
"""Test issue is logged when deprecated configuration is used."""
18-
await async_setup_component(
19-
hass, DOMAIN, {DOMAIN: {"app_id": "123", "access_key": "42"}}
20-
)
21-
await hass.async_block_till_done()
22-
assert issue_registry.async_get_issue(DOMAIN, "manual_migration")
237

248

259
@pytest.mark.parametrize(("exception_class"), [TTNAuthError, Exception])

0 commit comments

Comments
 (0)