mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Bugfix invalid entity_config parameter HomeKit (#17143)
This commit is contained in:
parent
769dda735d
commit
52ff232797
@ -44,6 +44,9 @@ SWITCH_TYPE_SCHEMA = BASIC_INFO_SCHEMA.extend({
|
|||||||
|
|
||||||
def validate_entity_config(values):
|
def validate_entity_config(values):
|
||||||
"""Validate config entry for CONF_ENTITY."""
|
"""Validate config entry for CONF_ENTITY."""
|
||||||
|
if not isinstance(values, dict):
|
||||||
|
raise vol.Invalid('expected a dictionary')
|
||||||
|
|
||||||
entities = {}
|
entities = {}
|
||||||
for entity_id, config in values.items():
|
for entity_id, config in values.items():
|
||||||
entity = cv.entity_id(entity_id)
|
entity = cv.entity_id(entity_id)
|
||||||
|
@ -23,7 +23,8 @@ from tests.common import async_mock_service
|
|||||||
|
|
||||||
def test_validate_entity_config():
|
def test_validate_entity_config():
|
||||||
"""Test validate entities."""
|
"""Test validate entities."""
|
||||||
configs = [{'invalid_entity_id': {}}, {'demo.test': 1},
|
configs = [None, [], 'string', 12345,
|
||||||
|
{'invalid_entity_id': {}}, {'demo.test': 1},
|
||||||
{'demo.test': 'test'}, {'demo.test': [1, 2]},
|
{'demo.test': 'test'}, {'demo.test': [1, 2]},
|
||||||
{'demo.test': None}, {'demo.test': {CONF_NAME: None}},
|
{'demo.test': None}, {'demo.test': {CONF_NAME: None}},
|
||||||
{'media_player.test': {CONF_FEATURE_LIST: [
|
{'media_player.test': {CONF_FEATURE_LIST: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user