diff --git a/homeassistant/components/uptime/sensor.py b/homeassistant/components/uptime/sensor.py index 3f7b7f5da25..ec65051867a 100644 --- a/homeassistant/components/uptime/sensor.py +++ b/homeassistant/components/uptime/sensor.py @@ -15,6 +15,7 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.device_registry import DeviceEntryType from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback +from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType import homeassistant.util.dt as dt_util @@ -38,6 +39,15 @@ async def async_setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the uptime sensor platform.""" + async_create_issue( + hass, + DOMAIN, + "removed_yaml", + breaks_in_ha_version="2022.12.0", + is_fixable=False, + severity=IssueSeverity.WARNING, + translation_key="removed_yaml", + ) hass.async_create_task( hass.config_entries.flow.async_init( DOMAIN, diff --git a/homeassistant/components/uptime/strings.json b/homeassistant/components/uptime/strings.json index 9ceb91de9ba..3d374015acb 100644 --- a/homeassistant/components/uptime/strings.json +++ b/homeassistant/components/uptime/strings.json @@ -9,5 +9,11 @@ "abort": { "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]" } + }, + "issues": { + "removed_yaml": { + "title": "The Uptime YAML configuration has been removed", + "description": "Configuring Uptime using YAML has been removed.\n\nYour existing YAML configuration is not used by Home Assistant.\n\nRemove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." + } } } diff --git a/homeassistant/components/uptime/translations/en.json b/homeassistant/components/uptime/translations/en.json index 5d38ae74e21..ec70b67c0e7 100644 --- a/homeassistant/components/uptime/translations/en.json +++ b/homeassistant/components/uptime/translations/en.json @@ -9,5 +9,11 @@ } } }, + "issues": { + "removed_yaml": { + "description": "Configuring Uptime using YAML has been removed.\n\nYour existing YAML configuration is not used by Home Assistant.\n\nRemove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.", + "title": "The Uptime YAML configuration has been removed" + } + }, "title": "Uptime" } \ No newline at end of file