diff --git a/homeassistant/components/moon/sensor.py b/homeassistant/components/moon/sensor.py index f3a3b3f48fa..b033dccc296 100644 --- a/homeassistant/components/moon/sensor.py +++ b/homeassistant/components/moon/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 @@ -52,6 +53,15 @@ async def async_setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the Moon sensor.""" + 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/moon/strings.json b/homeassistant/components/moon/strings.json index d5bb204a740..76ce886ded8 100644 --- a/homeassistant/components/moon/strings.json +++ b/homeassistant/components/moon/strings.json @@ -9,5 +9,11 @@ "abort": { "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]" } + }, + "issues": { + "removed_yaml": { + "title": "The Moon YAML configuration has been removed", + "description": "Configuring Moon 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/moon/translations/en.json b/homeassistant/components/moon/translations/en.json index 0f324f7b64b..2f6f73a9982 100644 --- a/homeassistant/components/moon/translations/en.json +++ b/homeassistant/components/moon/translations/en.json @@ -9,5 +9,11 @@ } } }, + "issues": { + "removed_yaml": { + "description": "Configuring Moon 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 Moon YAML configuration has been removed" + } + }, "title": "Moon" } \ No newline at end of file