Add support for device class in target selector (#43768)

This commit is contained in:
Paulus Schoutsen 2020-11-30 23:35:24 +01:00 committed by GitHub
parent 2f73590714
commit a5c79a1f84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -120,4 +120,4 @@ class TargetSelector(Selector):
Value should follow cv.ENTITY_SERVICE_FIELDS format.
"""
CONFIG_SCHEMA = vol.Schema({"entity": {"domain": str}})
CONFIG_SCHEMA = vol.Schema({"entity": {"domain": str, "device_class": str}})

View file

@ -125,6 +125,7 @@ def test_time_selector_schema(schema):
{},
{"entity": {}},
{"entity": {"domain": "light"}},
{"entity": {"domain": "binary_sensor", "device_class": "motion"}},
),
)
def test_target_selector_schema(schema):