diff --git a/homeassistant/helpers/selector.py b/homeassistant/helpers/selector.py index 5cc7ada1bc5..b48ffb6e964 100644 --- a/homeassistant/helpers/selector.py +++ b/homeassistant/helpers/selector.py @@ -162,3 +162,17 @@ class ActionSelector(Selector): """Selector of an action sequence (script syntax).""" CONFIG_SCHEMA = vol.Schema({}) + + +@SELECTORS.register("object") +class ObjectSelector(Selector): + """Selector for an arbitrary object.""" + + CONFIG_SCHEMA = vol.Schema({}) + + +@SELECTORS.register("text") +class StringSelector(Selector): + """Selector for a multi-line text string.""" + + CONFIG_SCHEMA = vol.Schema({vol.Optional("multiline", default=False): bool}) diff --git a/tests/helpers/test_selector.py b/tests/helpers/test_selector.py index 86ee6078e87..2916d616703 100644 --- a/tests/helpers/test_selector.py +++ b/tests/helpers/test_selector.py @@ -169,3 +169,21 @@ def test_target_selector_schema(schema): def test_action_selector_schema(schema): """Test action sequence selector.""" selector.validate_selector({"action": schema}) + + +@pytest.mark.parametrize( + "schema", + ({},), +) +def test_object_selector_schema(schema): + """Test object selector.""" + selector.validate_selector({"object": schema}) + + +@pytest.mark.parametrize( + "schema", + ({}, {"multiline": True}, {"multiline": False}), +) +def test_text_selector_schema(schema): + """Test text selector.""" + selector.validate_selector({"text": schema})