mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 05:47:10 +00:00
Finish migration from report to report_usage (#130412)
This commit is contained in:
parent
b57b22f6e3
commit
600f83ddab
@ -505,15 +505,14 @@ class HomeAssistantHTTP:
|
|||||||
self, url_path: str, path: str, cache_headers: bool = True
|
self, url_path: str, path: str, cache_headers: bool = True
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Register a folder or file to serve as a static path."""
|
"""Register a folder or file to serve as a static path."""
|
||||||
frame.report(
|
frame.report_usage(
|
||||||
"calls hass.http.register_static_path which is deprecated because "
|
"calls hass.http.register_static_path which is deprecated because "
|
||||||
"it does blocking I/O in the event loop, instead "
|
"it does blocking I/O in the event loop, instead "
|
||||||
"call `await hass.http.async_register_static_paths("
|
"call `await hass.http.async_register_static_paths("
|
||||||
f'[StaticPathConfig("{url_path}", "{path}", {cache_headers})])`; '
|
f'[StaticPathConfig("{url_path}", "{path}", {cache_headers})])`; '
|
||||||
"This function will be removed in 2025.7",
|
"This function will be removed in 2025.7",
|
||||||
exclude_integrations={"http"},
|
exclude_integrations={"http"},
|
||||||
error_if_core=False,
|
core_behavior=frame.ReportBehavior.LOG,
|
||||||
error_if_integration=False,
|
|
||||||
)
|
)
|
||||||
configs = [StaticPathConfig(url_path, path, cache_headers)]
|
configs = [StaticPathConfig(url_path, path, cache_headers)]
|
||||||
resources = self._make_static_resources(configs)
|
resources = self._make_static_resources(configs)
|
||||||
|
@ -63,7 +63,7 @@ from .helpers.event import (
|
|||||||
RANDOM_MICROSECOND_MIN,
|
RANDOM_MICROSECOND_MIN,
|
||||||
async_call_later,
|
async_call_later,
|
||||||
)
|
)
|
||||||
from .helpers.frame import ReportBehavior, report, report_usage
|
from .helpers.frame import ReportBehavior, report_usage
|
||||||
from .helpers.json import json_bytes, json_bytes_sorted, json_fragment
|
from .helpers.json import json_bytes, json_bytes_sorted, json_fragment
|
||||||
from .helpers.typing import UNDEFINED, ConfigType, DiscoveryInfoType, UndefinedType
|
from .helpers.typing import UNDEFINED, ConfigType, DiscoveryInfoType, UndefinedType
|
||||||
from .loader import async_suggest_report_issue
|
from .loader import async_suggest_report_issue
|
||||||
@ -1191,14 +1191,13 @@ class FlowCancelledError(Exception):
|
|||||||
|
|
||||||
def _report_non_awaited_platform_forwards(entry: ConfigEntry, what: str) -> None:
|
def _report_non_awaited_platform_forwards(entry: ConfigEntry, what: str) -> None:
|
||||||
"""Report non awaited platform forwards."""
|
"""Report non awaited platform forwards."""
|
||||||
report(
|
report_usage(
|
||||||
f"calls {what} for integration {entry.domain} with "
|
f"calls {what} for integration {entry.domain} with "
|
||||||
f"title: {entry.title} and entry_id: {entry.entry_id}, "
|
f"title: {entry.title} and entry_id: {entry.entry_id}, "
|
||||||
f"during setup without awaiting {what}, which can cause "
|
f"during setup without awaiting {what}, which can cause "
|
||||||
"the setup lock to be released before the setup is done. "
|
"the setup lock to be released before the setup is done. "
|
||||||
"This will stop working in Home Assistant 2025.1",
|
"This will stop working in Home Assistant 2025.1",
|
||||||
error_if_integration=False,
|
core_behavior=ReportBehavior.LOG,
|
||||||
error_if_core=False,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1266,10 +1265,8 @@ class ConfigEntriesFlowManager(
|
|||||||
SOURCE_RECONFIGURE,
|
SOURCE_RECONFIGURE,
|
||||||
} and "entry_id" not in context:
|
} and "entry_id" not in context:
|
||||||
# Deprecated in 2024.12, should fail in 2025.12
|
# Deprecated in 2024.12, should fail in 2025.12
|
||||||
report(
|
report_usage(
|
||||||
f"initialises a {source} flow without a link to the config entry",
|
f"initialises a {source} flow without a link to the config entry",
|
||||||
error_if_integration=False,
|
|
||||||
error_if_core=True,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
flow_id = ulid_util.ulid_now()
|
flow_id = ulid_util.ulid_now()
|
||||||
@ -2321,14 +2318,13 @@ class ConfigEntries:
|
|||||||
multiple platforms at once and is more efficient since it
|
multiple platforms at once and is more efficient since it
|
||||||
does not require a separate import executor job for each platform.
|
does not require a separate import executor job for each platform.
|
||||||
"""
|
"""
|
||||||
report(
|
report_usage(
|
||||||
"calls async_forward_entry_setup for "
|
"calls async_forward_entry_setup for "
|
||||||
f"integration, {entry.domain} with title: {entry.title} "
|
f"integration, {entry.domain} with title: {entry.title} "
|
||||||
f"and entry_id: {entry.entry_id}, which is deprecated and "
|
f"and entry_id: {entry.entry_id}, which is deprecated and "
|
||||||
"will stop working in Home Assistant 2025.6, "
|
"will stop working in Home Assistant 2025.6, "
|
||||||
"await async_forward_entry_setups instead",
|
"await async_forward_entry_setups instead",
|
||||||
error_if_core=False,
|
core_behavior=ReportBehavior.LOG,
|
||||||
error_if_integration=False,
|
|
||||||
)
|
)
|
||||||
if not entry.setup_lock.locked():
|
if not entry.setup_lock.locked():
|
||||||
async with entry.setup_lock:
|
async with entry.setup_lock:
|
||||||
|
@ -224,10 +224,10 @@ def async_track_state_change(
|
|||||||
|
|
||||||
Must be run within the event loop.
|
Must be run within the event loop.
|
||||||
"""
|
"""
|
||||||
frame.report(
|
frame.report_usage(
|
||||||
"calls `async_track_state_change` instead of `async_track_state_change_event`"
|
"calls `async_track_state_change` instead of `async_track_state_change_event`"
|
||||||
" which is deprecated and will be removed in Home Assistant 2025.5",
|
" which is deprecated and will be removed in Home Assistant 2025.5",
|
||||||
error_if_core=False,
|
core_behavior=frame.ReportBehavior.LOG,
|
||||||
)
|
)
|
||||||
|
|
||||||
if from_state is not None:
|
if from_state is not None:
|
||||||
|
@ -39,7 +39,7 @@ def create_eager_task[_T](
|
|||||||
# pylint: disable-next=import-outside-toplevel
|
# pylint: disable-next=import-outside-toplevel
|
||||||
from homeassistant.helpers import frame
|
from homeassistant.helpers import frame
|
||||||
|
|
||||||
frame.report("attempted to create an asyncio task from a thread")
|
frame.report_usage("attempted to create an asyncio task from a thread")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
return Task(coro, loop=loop, name=name, eager_start=True)
|
return Task(coro, loop=loop, name=name, eager_start=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user