mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Add new frame helper to better distinguish custom and core integrations (#130025)
* Add new frame helper to clarify options available * Adjust * Improve * Use report_usage in core * Add tests * Use is/is not Co-authored-by: J. Nick Koston <nick@koston.org> * Use enum.auto() --------- Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
@ -656,12 +656,12 @@ class HomeAssistant:
|
||||
# late import to avoid circular imports
|
||||
from .helpers import frame # pylint: disable=import-outside-toplevel
|
||||
|
||||
frame.report(
|
||||
frame.report_usage(
|
||||
"calls `async_add_job`, which is deprecated and will be removed in Home "
|
||||
"Assistant 2025.4; Please review "
|
||||
"https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job"
|
||||
" for replacement options",
|
||||
error_if_core=False,
|
||||
core_behavior=frame.ReportBehavior.LOG,
|
||||
)
|
||||
|
||||
if target is None:
|
||||
@ -712,12 +712,12 @@ class HomeAssistant:
|
||||
# late import to avoid circular imports
|
||||
from .helpers import frame # pylint: disable=import-outside-toplevel
|
||||
|
||||
frame.report(
|
||||
frame.report_usage(
|
||||
"calls `async_add_hass_job`, which is deprecated and will be removed in Home "
|
||||
"Assistant 2025.5; Please review "
|
||||
"https://developers.home-assistant.io/blog/2024/04/07/deprecate_add_hass_job"
|
||||
" for replacement options",
|
||||
error_if_core=False,
|
||||
core_behavior=frame.ReportBehavior.LOG,
|
||||
)
|
||||
|
||||
return self._async_add_hass_job(hassjob, *args, background=background)
|
||||
@ -986,12 +986,12 @@ class HomeAssistant:
|
||||
# late import to avoid circular imports
|
||||
from .helpers import frame # pylint: disable=import-outside-toplevel
|
||||
|
||||
frame.report(
|
||||
frame.report_usage(
|
||||
"calls `async_run_job`, which is deprecated and will be removed in Home "
|
||||
"Assistant 2025.4; Please review "
|
||||
"https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job"
|
||||
" for replacement options",
|
||||
error_if_core=False,
|
||||
core_behavior=frame.ReportBehavior.LOG,
|
||||
)
|
||||
|
||||
if asyncio.iscoroutine(target):
|
||||
@ -1635,10 +1635,10 @@ class EventBus:
|
||||
# late import to avoid circular imports
|
||||
from .helpers import frame # pylint: disable=import-outside-toplevel
|
||||
|
||||
frame.report(
|
||||
frame.report_usage(
|
||||
"calls `async_listen` with run_immediately, which is"
|
||||
" deprecated and will be removed in Home Assistant 2025.5",
|
||||
error_if_core=False,
|
||||
core_behavior=frame.ReportBehavior.LOG,
|
||||
)
|
||||
|
||||
if event_filter is not None and not is_callback_check_partial(event_filter):
|
||||
@ -1705,10 +1705,10 @@ class EventBus:
|
||||
# late import to avoid circular imports
|
||||
from .helpers import frame # pylint: disable=import-outside-toplevel
|
||||
|
||||
frame.report(
|
||||
frame.report_usage(
|
||||
"calls `async_listen_once` with run_immediately, which is "
|
||||
"deprecated and will be removed in Home Assistant 2025.5",
|
||||
error_if_core=False,
|
||||
core_behavior=frame.ReportBehavior.LOG,
|
||||
)
|
||||
|
||||
one_time_listener: _OneTimeListener[_DataT] = _OneTimeListener(
|
||||
|
Reference in New Issue
Block a user