Add pre-defined entity name translations (#89792)

This commit is contained in:
Franck Nijhof
2023-03-16 21:10:20 +01:00
committed by GitHub
parent e6f280cf7a
commit f9919bb7cf
34 changed files with 402 additions and 4 deletions

View File

@@ -383,22 +383,25 @@ async def test_caching(hass: HomeAssistant) -> None:
for key in load1:
assert key.startswith(
"component.sensor.entity_component._.state."
) or key.startswith("component.light.entity_component._.state.")
(
"component.sensor.entity_component.",
"component.light.entity_component.",
)
)
load_sensor_only = await translation.async_get_translations(
hass, "en", "entity_component", integrations={"sensor"}
)
assert load_sensor_only
for key in load_sensor_only:
assert key.startswith("component.sensor.entity_component._.state.")
assert key.startswith("component.sensor.entity_component.")
load_light_only = await translation.async_get_translations(
hass, "en", "entity_component", integrations={"light"}
)
assert load_light_only
for key in load_light_only:
assert key.startswith("component.light.entity_component._.state.")
assert key.startswith("component.light.entity_component.")
hass.config.components.add("media_player")