mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Fix packages when config schema is fully deprecated (#36674)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
2d5faaf3f8
commit
0146f35687
@ -559,6 +559,9 @@ def _log_pkg_error(package: str, component: str, config: Dict, message: str) ->
|
|||||||
|
|
||||||
def _identify_config_schema(module: ModuleType) -> Optional[str]:
|
def _identify_config_schema(module: ModuleType) -> Optional[str]:
|
||||||
"""Extract the schema and identify list or dict based."""
|
"""Extract the schema and identify list or dict based."""
|
||||||
|
if not isinstance(module.CONFIG_SCHEMA, vol.Schema): # type: ignore
|
||||||
|
return None
|
||||||
|
|
||||||
schema = module.CONFIG_SCHEMA.schema # type: ignore
|
schema = module.CONFIG_SCHEMA.schema # type: ignore
|
||||||
|
|
||||||
if isinstance(schema, vol.All):
|
if isinstance(schema, vol.All):
|
||||||
|
@ -28,6 +28,7 @@ from homeassistant.const import (
|
|||||||
__version__,
|
__version__,
|
||||||
)
|
)
|
||||||
from homeassistant.core import SOURCE_STORAGE, HomeAssistantError
|
from homeassistant.core import SOURCE_STORAGE, HomeAssistantError
|
||||||
|
from homeassistant.helpers import config_validation as cv
|
||||||
import homeassistant.helpers.check_config as check_config
|
import homeassistant.helpers.check_config as check_config
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.loader import async_get_integration
|
from homeassistant.loader import async_get_integration
|
||||||
@ -1029,6 +1030,7 @@ async def test_component_config_exceptions(hass, caplog):
|
|||||||
("non_existing", vol.Schema({"zone": int}), None),
|
("non_existing", vol.Schema({"zone": int}), None),
|
||||||
("zone", vol.Schema({}), None),
|
("zone", vol.Schema({}), None),
|
||||||
("plex", vol.Schema(vol.All({"plex": {"host": str}})), "dict"),
|
("plex", vol.Schema(vol.All({"plex": {"host": str}})), "dict"),
|
||||||
|
("openuv", cv.deprecated("openuv", invalidation_version="0.115"), None),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_identify_config_schema(domain, schema, expected):
|
def test_identify_config_schema(domain, schema, expected):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user