Deprecate the Deutsche Bahn (#76286)
This commit is contained in:
parent
3b29cbcd61
commit
babb3d10a1
4 changed files with 33 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
"name": "Deutsche Bahn",
|
||||
"documentation": "https://www.home-assistant.io/integrations/deutsche_bahn",
|
||||
"requirements": ["schiene==0.23"],
|
||||
"dependencies": ["repairs"],
|
||||
"codeowners": [],
|
||||
"iot_class": "cloud_polling",
|
||||
"loggers": ["schiene"]
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
import schiene
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.repairs import IssueSeverity, create_issue
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.const import CONF_OFFSET
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -33,6 +35,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
}
|
||||
)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def setup_platform(
|
||||
hass: HomeAssistant,
|
||||
|
@ -45,7 +49,18 @@ def setup_platform(
|
|||
destination = config[CONF_DESTINATION]
|
||||
offset = config[CONF_OFFSET]
|
||||
only_direct = config[CONF_ONLY_DIRECT]
|
||||
|
||||
create_issue(
|
||||
hass,
|
||||
"deutsche_bahn",
|
||||
"pending_removal",
|
||||
breaks_in_ha_version="2022.11.0",
|
||||
is_fixable=False,
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key="pending_removal",
|
||||
)
|
||||
_LOGGER.warning(
|
||||
"The Deutsche Bahn sensor component is deprecated and will be removed in Home Assistant 2022.11"
|
||||
)
|
||||
add_entities([DeutscheBahnSensor(start, destination, offset, only_direct)], True)
|
||||
|
||||
|
||||
|
|
8
homeassistant/components/deutsche_bahn/strings.json
Normal file
8
homeassistant/components/deutsche_bahn/strings.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"issues": {
|
||||
"pending_removal": {
|
||||
"title": "The Deutsche Bahn integration is being removed",
|
||||
"description": "The Deutsche Bahn integration is pending removal from Home Assistant and will no longer be available as of Home Assistant 2022.11.\n\nThe integration is being removed, because it relies on webscraping, which is not allowed.\n\nRemove the Deutsche Bahn YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue."
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"issues": {
|
||||
"pending_removal": {
|
||||
"description": "The Deutsche Bahn integration is pending removal from Home Assistant and will no longer be available as of Home Assistant 2022.11.\n\nThe integration is being removed, because it relies on webscraping, which is not allowed.\n\nRemove the Deutsche Bahn YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.",
|
||||
"title": "The Deutsche Bahn integration is being removed"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue