mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +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]:
|
||||
"""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
|
||||
|
||||
if isinstance(schema, vol.All):
|
||||
|
@ -28,6 +28,7 @@ from homeassistant.const import (
|
||||
__version__,
|
||||
)
|
||||
from homeassistant.core import SOURCE_STORAGE, HomeAssistantError
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
import homeassistant.helpers.check_config as check_config
|
||||
from homeassistant.helpers.entity import Entity
|
||||
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),
|
||||
("zone", vol.Schema({}), None),
|
||||
("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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user