Remove deprecated history function entry points (#71815)

This commit is contained in:
J. Nick Koston 2022-05-13 16:19:26 -04:00 committed by GitHub
parent 535ae56fe7
commit e06ea5e03e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,7 +29,6 @@ from homeassistant.components.websocket_api.const import JSON_DUMP
from homeassistant.const import CONF_DOMAINS, CONF_ENTITIES, CONF_EXCLUDE, CONF_INCLUDE
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.deprecation import deprecated_class, deprecated_function
from homeassistant.helpers.entityfilter import (
CONF_ENTITY_GLOBS,
INCLUDE_EXCLUDE_BASE_FILTER_SCHEMA,
@ -60,28 +59,6 @@ CONFIG_SCHEMA = vol.Schema(
)
@deprecated_function("homeassistant.components.recorder.history.get_significant_states")
def get_significant_states(hass, *args, **kwargs):
"""Wrap get_significant_states_with_session with an sql session."""
return history.get_significant_states(hass, *args, **kwargs)
@deprecated_function(
"homeassistant.components.recorder.history.state_changes_during_period"
)
def state_changes_during_period(hass, start_time, end_time=None, entity_id=None):
"""Return states changes during UTC period start_time - end_time."""
return history.state_changes_during_period(
hass, start_time, end_time=None, entity_id=None
)
@deprecated_function("homeassistant.components.recorder.history.get_last_state_changes")
def get_last_state_changes(hass, number_of_states, entity_id):
"""Return the last number_of_states."""
return history.get_last_state_changes(hass, number_of_states, entity_id)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the history hooks."""
conf = config.get(DOMAIN, {})
@ -101,11 +78,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
return True
@deprecated_class("homeassistant.components.recorder.models.LazyState")
class LazyState(history_models.LazyState):
"""A lazy version of core State."""
def _ws_get_statistics_during_period(
hass: HomeAssistant,
msg_id: int,