diff --git a/homeassistant/helpers/selector.py b/homeassistant/helpers/selector.py index 7f7a4d16595..e5fa493330e 100644 --- a/homeassistant/helpers/selector.py +++ b/homeassistant/helpers/selector.py @@ -781,7 +781,6 @@ class StateSelectorConfig(TypedDict, total=False): """Class to represent an state selector config.""" entity_id: str - attribute: str @SELECTORS.register("state") @@ -793,7 +792,11 @@ class StateSelector(Selector): CONFIG_SCHEMA = vol.Schema( { vol.Required("entity_id"): cv.entity_id, - vol.Optional("attribute"): str, + # The attribute to filter on, is currently deliberately not + # configurable/exposed. We are considering separating state + # selectors into two types: one for state and one for attribute. + # Limiting the public use, prevents breaking changes in the future. + # vol.Optional("attribute"): str, } ) diff --git a/tests/helpers/test_selector.py b/tests/helpers/test_selector.py index 5472e6609f0..4c20a3b7906 100644 --- a/tests/helpers/test_selector.py +++ b/tests/helpers/test_selector.py @@ -322,11 +322,6 @@ def test_time_selector_schema(schema, valid_selections, invalid_selections): ("on", "armed"), (None, True, 1), ), - ( - {"entity_id": "sensor.abc", "attribute": "device_class"}, - ("temperature", "humidity"), - (None,), - ), ), ) def test_state_selector_schema(schema, valid_selections, invalid_selections):