1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Limit legacy state translations to custom components (#112295)

* Limit legacy state translations to custom components

We were trying to load **thousands** of `*.light.json`, `*.switch.json` files at run time that did not exist.

There have been replaced with entity translations: https://github.com/home-assistant/developers.home-assistant/pull/1557 https://github.com/home-assistant/core/pull/82701

https://github.com/home-assistant/core/pull/112023 will completely remove them, but
for now we will only load them for custom components to reduce the number
of files having to be examined

* reduce

* reduce

* reduce

* reduce

* comment

* coverage

* try to remove empty dict in loaded_translations fallback when missing
This commit is contained in:
J. Nick Koston
2024-03-05 12:27:45 -10:00
committed by GitHub
parent d34e2c1f12
commit fbabbc8f92
6 changed files with 106 additions and 26 deletions
@@ -0,0 +1 @@
"""Provide a mock package component."""
@@ -0,0 +1,7 @@
{
"domain": "test_legacy_state_translations",
"name": "Test package for legacy state translations",
"documentation": "http://test-package.io",
"config_flow": true,
"version": "1.2.3"
}
@@ -0,0 +1 @@
"""Provide a mock package component."""
@@ -0,0 +1,7 @@
{
"domain": "test_legacy_state_translations_bad_data",
"name": "Test package for legacy state translations",
"documentation": "http://test-package.io",
"config_flow": true,
"version": "1.2.3"
}