Rename recorder INTEGRATION_PLATFORMS_RUN_IN_RECORDER_THREAD (#122758)

This commit is contained in:
Erik Montnemery 2024-07-29 11:38:21 +02:00 committed by GitHub
parent ca430f0e7b
commit efaf75f2e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -33,7 +33,7 @@ from .const import ( # noqa: F401
CONF_DB_INTEGRITY_CHECK,
DOMAIN,
INTEGRATION_PLATFORM_COMPILE_STATISTICS,
INTEGRATION_PLATFORMS_RUN_IN_RECORDER_THREAD,
INTEGRATION_PLATFORM_METHODS,
SQLITE_URL_PREFIX,
SupportedDialect,
)
@ -189,10 +189,7 @@ async def _async_setup_integration_platform(
"""Process a recorder platform."""
# If the platform has a compile_statistics method, we need to
# add it to the recorder queue to be processed.
if any(
hasattr(platform, _attr)
for _attr in INTEGRATION_PLATFORMS_RUN_IN_RECORDER_THREAD
):
if any(hasattr(platform, _attr) for _attr in INTEGRATION_PLATFORM_METHODS):
instance.queue_task(AddRecorderPlatformTask(domain, platform))
await async_process_integration_platforms(hass, DOMAIN, _process_recorder_platform)

View File

@ -66,7 +66,7 @@ INTEGRATION_PLATFORM_COMPILE_STATISTICS = "compile_statistics"
INTEGRATION_PLATFORM_VALIDATE_STATISTICS = "validate_statistics"
INTEGRATION_PLATFORM_LIST_STATISTIC_IDS = "list_statistic_ids"
INTEGRATION_PLATFORMS_RUN_IN_RECORDER_THREAD = {
INTEGRATION_PLATFORM_METHODS = {
INTEGRATION_PLATFORM_COMPILE_STATISTICS,
INTEGRATION_PLATFORM_VALIDATE_STATISTICS,
INTEGRATION_PLATFORM_LIST_STATISTIC_IDS,