From 415122a0742f253ab5ceb3f29b2e931e78dfe9a8 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 10 Jul 2025 09:34:06 +0000 Subject: [PATCH] Adjust deprecation message --- homeassistant/helpers/deprecation.py | 10 ++++++---- tests/helpers/test_service.py | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/homeassistant/helpers/deprecation.py b/homeassistant/helpers/deprecation.py index ab72fa02f6c..922adec92c9 100644 --- a/homeassistant/helpers/deprecation.py +++ b/homeassistant/helpers/deprecation.py @@ -149,12 +149,14 @@ def deprecate_hass_binding[**_P, _T]( from homeassistant.core import HomeAssistant # noqa: PLC0415 if isinstance(args[0], HomeAssistant): - _print_deprecation_warning( - func, - "without hass", + _print_deprecation_warning_internal( + "hass", + func.__module__, + f"{func.__name__} without hass argument", "argument", - "called with hass as the first argument", + f"passed to {func.__name__}", breaks_in_ha_version, + log_when_no_integration_is_found=True, ) args = args[1:] # type: ignore[assignment] return func(*args, **kwargs) diff --git a/tests/helpers/test_service.py b/tests/helpers/test_service.py index 7c52ab9713b..ed5d36a3b54 100644 --- a/tests/helpers/test_service.py +++ b/tests/helpers/test_service.py @@ -1712,8 +1712,9 @@ async def test_register_admin_service_return_response( _DEPRECATED_VERIFY_DOMAIN_CONTROL_MESSAGE = ( - "verify_domain_control is a deprecated argument which will be removed" - " in HA Core 2026.2. Use without hass instead" + "The deprecated argument hass was passed to verify_domain_control. It will be" + " removed in HA Core 2026.2. Use verify_domain_control without hass argument" + " instead" )