mirror of
https://github.com/home-assistant/core.git
synced 2026-07-12 09:07:59 +01:00
Remove unused states_entity_filter from recorder Filters (#176116)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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."""
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user