Remove deprecated automation constants (#131792)

This commit is contained in:
Robert Resch
2024-11-28 11:07:00 +01:00
committed by GitHub
parent be81fd86d3
commit fb152c7d22
2 changed files with 2 additions and 62 deletions

View File

@@ -50,7 +50,6 @@ from homeassistant.helpers.script import (
SCRIPT_MODE_SINGLE,
_async_stop_scripts_at_shutdown,
)
from homeassistant.helpers.trigger import TriggerActionType, TriggerData, TriggerInfo
from homeassistant.setup import async_setup_component
from homeassistant.util import yaml
import homeassistant.util.dt as dt_util
@@ -62,8 +61,6 @@ from tests.common import (
async_capture_events,
async_fire_time_changed,
async_mock_service,
help_test_all,
import_and_test_deprecated_constant,
mock_restore_cache,
)
from tests.components.logbook.common import MockRow, mock_humanify
@@ -3153,30 +3150,6 @@ async def test_websocket_config(
assert msg["error"]["code"] == "not_found"
def test_all() -> None:
"""Test module.__all__ is correctly set."""
help_test_all(automation)
@pytest.mark.parametrize(
("constant_name", "replacement"),
[
("AutomationActionType", TriggerActionType),
("AutomationTriggerData", TriggerData),
("AutomationTriggerInfo", TriggerInfo),
],
)
def test_deprecated_constants(
caplog: pytest.LogCaptureFixture,
constant_name: str,
replacement: Any,
) -> None:
"""Test deprecated automation constants."""
import_and_test_deprecated_constant(
caplog, automation, constant_name, replacement.__name__, replacement, "2025.1"
)
async def test_automation_turns_off_other_automation(hass: HomeAssistant) -> None:
"""Test an automation that turns off another automation."""
hass.set_state(CoreState.not_running)