From a5c79a1f84c66760d3630deb4fd0920e53da1982 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 30 Nov 2020 23:35:24 +0100 Subject: [PATCH] Add support for device class in target selector (#43768) --- homeassistant/helpers/selector.py | 2 +- tests/helpers/test_selector.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/helpers/selector.py b/homeassistant/helpers/selector.py index d81fa396c0b..b4a90212bce 100644 --- a/homeassistant/helpers/selector.py +++ b/homeassistant/helpers/selector.py @@ -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}}) diff --git a/tests/helpers/test_selector.py b/tests/helpers/test_selector.py index 2c2034147a1..531d36e4f50 100644 --- a/tests/helpers/test_selector.py +++ b/tests/helpers/test_selector.py @@ -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):