diff --git a/homeassistant/core.py b/homeassistant/core.py index 34fd164c47dc..4887d7003281 100644 --- a/homeassistant/core.py +++ b/homeassistant/core.py @@ -1728,8 +1728,9 @@ class EventBus: frame.report_usage( "calls `async_listen` with run_immediately", - core_behavior=frame.ReportBehavior.LOG, - breaks_in_ha_version="2025.5", + core_behavior=frame.ReportBehavior.ERROR, + core_integration_behavior=frame.ReportBehavior.ERROR, + custom_integration_behavior=frame.ReportBehavior.ERROR, ) if event_filter is not None and not is_callback_check_partial(event_filter): @@ -1798,8 +1799,9 @@ class EventBus: frame.report_usage( "calls `async_listen_once` with run_immediately", - core_behavior=frame.ReportBehavior.LOG, - breaks_in_ha_version="2025.5", + core_behavior=frame.ReportBehavior.ERROR, + core_integration_behavior=frame.ReportBehavior.ERROR, + custom_integration_behavior=frame.ReportBehavior.ERROR, ) one_time_listener: _OneTimeListener[_DataT] = _OneTimeListener( diff --git a/tests/test_core.py b/tests/test_core.py index 697d655acb14..6a9aa7019682 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -3529,11 +3529,11 @@ async def test_async_listen_with_run_immediately_deprecated( pass func = getattr(hass.bus, method) - func(EVENT_HOMEASSISTANT_START, _test, run_immediately=run_immediately) - assert ( - f"Detected code that calls `{method}` with run_immediately. " - "This will stop working in Home Assistant 2025.5" - ) in caplog.text + with pytest.raises( + RuntimeError, + match=f"Detected code that calls `{method}` with run_immediately. Please report this issue", + ): + func(EVENT_HOMEASSISTANT_START, _test, run_immediately=run_immediately) async def test_async_fire_thread_safety(hass: HomeAssistant) -> None: