Adjust deprecation message

This commit is contained in:
epenet 2025-07-10 09:34:06 +00:00
parent b01cc38bc8
commit 415122a074
2 changed files with 9 additions and 6 deletions

View File

@ -149,12 +149,14 @@ def deprecate_hass_binding[**_P, _T](
from homeassistant.core import HomeAssistant # noqa: PLC0415 from homeassistant.core import HomeAssistant # noqa: PLC0415
if isinstance(args[0], HomeAssistant): if isinstance(args[0], HomeAssistant):
_print_deprecation_warning( _print_deprecation_warning_internal(
func, "hass",
"without hass", func.__module__,
f"{func.__name__} without hass argument",
"argument", "argument",
"called with hass as the first argument", f"passed to {func.__name__}",
breaks_in_ha_version, breaks_in_ha_version,
log_when_no_integration_is_found=True,
) )
args = args[1:] # type: ignore[assignment] args = args[1:] # type: ignore[assignment]
return func(*args, **kwargs) return func(*args, **kwargs)

View File

@ -1712,8 +1712,9 @@ async def test_register_admin_service_return_response(
_DEPRECATED_VERIFY_DOMAIN_CONTROL_MESSAGE = ( _DEPRECATED_VERIFY_DOMAIN_CONTROL_MESSAGE = (
"verify_domain_control is a deprecated argument which will be removed" "The deprecated argument hass was passed to verify_domain_control. It will be"
" in HA Core 2026.2. Use without hass instead" " removed in HA Core 2026.2. Use verify_domain_control without hass argument"
" instead"
) )