1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Improve entity translation typing (#112788)

* Improve entity translation typing

* Improve entity translation typing
This commit is contained in:
J. Nick Koston
2024-03-08 17:30:13 -10:00
committed by GitHub
parent a66399ad3d
commit 6a7c255b93
2 changed files with 7 additions and 9 deletions

View File

@@ -130,10 +130,10 @@ class EntityPlatform:
# Storage for entities for this specific platform only
# which are indexed by entity_id
self.entities: dict[str, Entity] = {}
self.component_translations: dict[str, Any] = {}
self.platform_translations: dict[str, Any] = {}
self.object_id_component_translations: dict[str, Any] = {}
self.object_id_platform_translations: dict[str, Any] = {}
self.component_translations: dict[str, str] = {}
self.platform_translations: dict[str, str] = {}
self.object_id_component_translations: dict[str, str] = {}
self.object_id_platform_translations: dict[str, str] = {}
self._tasks: list[asyncio.Task[None]] = []
# Stop tracking tasks after setup is completed
self._setup_complete = False
@@ -419,7 +419,7 @@ class EntityPlatform:
async def _async_get_translations(
self, language: str, category: str, integration: str
) -> dict[str, Any]:
) -> dict[str, str]:
"""Get translations for a language, category, and integration."""
try:
return await translation.async_get_translations(