From a02e54f332b2e9f27f9ee2e4f043b7ace2e61e95 Mon Sep 17 00:00:00 2001 From: Petro31 <35082313+Petro31@users.noreply.github.com> Date: Thu, 21 May 2026 12:47:39 -0400 Subject: [PATCH] Update documentation link to point to each domain/platform (#171734) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- homeassistant/components/template/const.py | 2 -- homeassistant/components/template/helpers.py | 35 ++++++++++++-------- homeassistant/components/template/weather.py | 20 +++-------- 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/homeassistant/components/template/const.py b/homeassistant/components/template/const.py index 98e4caab9fe..f5b584f4c16 100644 --- a/homeassistant/components/template/const.py +++ b/homeassistant/components/template/const.py @@ -19,8 +19,6 @@ CONF_TURN_ON = "turn_on" DOMAIN = "template" -DOCUMENTATION_URL = "https://www.home-assistant.io/integrations/template/" - PLATFORM_STORAGE_KEY = "template_platforms" PLATFORMS = [ diff --git a/homeassistant/components/template/helpers.py b/homeassistant/components/template/helpers.py index b83a1d4e092..959fbcb0bc3 100644 --- a/homeassistant/components/template/helpers.py +++ b/homeassistant/components/template/helpers.py @@ -29,13 +29,9 @@ from homeassistant.helpers.entity_platform import ( from homeassistant.helpers.script import async_validate_actions_config from homeassistant.helpers.singleton import singleton from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType +from homeassistant.util import slugify -from .const import ( - CONF_ADVANCED_OPTIONS, - CONF_DEFAULT_ENTITY_ID, - DOCUMENTATION_URL, - DOMAIN, -) +from .const import CONF_ADVANCED_OPTIONS, CONF_DEFAULT_ENTITY_ID, DOMAIN from .entity import AbstractTemplateEntity from .template_entity import TemplateEntity from .trigger_entity import TriggerEntity @@ -166,6 +162,24 @@ async def validate_template_scripts( ) +def async_create_platform_template_not_supported_issue( + hass: HomeAssistant, domain: str +): + """Create a platform: template not supported issue.""" + learn_more_url = ( + "https://www.home-assistant.io/integrations/template/" + f"#{slugify(domain, separator='-')}" + ) + async_create_platform_config_not_supported_issue( + hass, + DOMAIN, + domain, + yaml_config_under_integration_supported=True, + learn_more_url=learn_more_url, + logger=_LOGGER, + ) + + async def async_setup_template_platform( hass: HomeAssistant, domain: str, @@ -179,14 +193,7 @@ async def async_setup_template_platform( """Set up the Template platform.""" if discovery_info is None: # Legacy Configuration - async_create_platform_config_not_supported_issue( - hass, - DOMAIN, - domain, - yaml_config_under_integration_supported=True, - learn_more_url=DOCUMENTATION_URL, - logger=_LOGGER, - ) + async_create_platform_template_not_supported_issue(hass, domain) return # Trigger Configuration diff --git a/homeassistant/components/template/weather.py b/homeassistant/components/template/weather.py index 60d9db91930..3c16c43a69e 100644 --- a/homeassistant/components/template/weather.py +++ b/homeassistant/components/template/weather.py @@ -46,7 +46,6 @@ from homeassistant.helpers import config_validation as cv, template from homeassistant.helpers.entity_platform import ( AddConfigEntryEntitiesCallback, AddEntitiesCallback, - async_create_platform_config_not_supported_issue, ) from homeassistant.helpers.restore_state import ExtraStoredData, RestoreEntity from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType @@ -57,15 +56,11 @@ from homeassistant.util.unit_conversion import ( TemperatureConverter, ) -from . import DOMAIN, TriggerUpdateCoordinator, validators as template_validators -from .const import ( - CONF_AVAILABILITY, - CONF_AVAILABILITY_TEMPLATE, - CONF_PICTURE, - DOCUMENTATION_URL, -) +from . import TriggerUpdateCoordinator, validators as template_validators +from .const import CONF_AVAILABILITY, CONF_AVAILABILITY_TEMPLATE, CONF_PICTURE from .entity import AbstractTemplateEntity from .helpers import ( + async_create_platform_template_not_supported_issue, async_setup_template_entry, async_setup_template_platform, async_setup_template_preview, @@ -279,14 +274,7 @@ async def async_setup_platform( # Rewrite the configuration options to modern keys. if discovery_info is None: - async_create_platform_config_not_supported_issue( - hass, - DOMAIN, - WEATHER_DOMAIN, - yaml_config_under_integration_supported=True, - learn_more_url=DOCUMENTATION_URL, - logger=_LOGGER, - ) + async_create_platform_template_not_supported_issue(hass, WEATHER_DOMAIN) return # Modern and Trigger