diff --git a/homeassistant/components/recorder/filters.py b/homeassistant/components/recorder/filters.py index d44d1d836fee..33a0df382171 100644 --- a/homeassistant/components/recorder/filters.py +++ b/homeassistant/components/recorder/filters.py @@ -11,7 +11,7 @@ from homeassistant.helpers.entityfilter import CONF_ENTITY_GLOBS from homeassistant.helpers.json import json_dumps from homeassistant.helpers.typing import ConfigType -from .db_schema import ENTITY_ID_IN_EVENT, OLD_ENTITY_ID_IN_EVENT, States, StatesMeta +from .db_schema import ENTITY_ID_IN_EVENT, OLD_ENTITY_ID_IN_EVENT, StatesMeta DOMAIN = "history" HISTORY_FILTERS = "history_filters" @@ -205,19 +205,6 @@ class Filters: # - Otherwise: exclude return i_entities - def states_entity_filter(self) -> ColumnElement: - """Generate the States.entity_id filter query. - - This is no longer used except by the legacy queries. - """ - - def _encoder(data: Any) -> Any: - """Nothing to encode for states since there is no json.""" - return data - - # The type annotation should be improved so the type ignore can be removed - return self._generate_filter_for_columns((States.entity_id,), _encoder) # type: ignore[arg-type] - def states_metadata_entity_filter(self) -> ColumnElement: """Generate the StatesMeta.entity_id filter query.""" diff --git a/tests/components/recorder/test_filters.py b/tests/components/recorder/test_filters.py index 2ba7bfbcd0b4..82cf2e786b82 100644 --- a/tests/components/recorder/test_filters.py +++ b/tests/components/recorder/test_filters.py @@ -150,13 +150,5 @@ async def test_an_empty_filter_raises() -> None: "No filter configuration provided, check" " has_config before calling this method" ), - ): - filters.states_entity_filter() - with pytest.raises( - RuntimeError, - match=( - "No filter configuration provided, check" - " has_config before calling this method" - ), ): filters.events_entity_filter()