mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Remove deprecated alarm panel constants (#153876)
This commit is contained in:
@@ -8,7 +8,6 @@ from typing import TYPE_CHECKING, Final
|
||||
|
||||
from .generated.entity_platforms import EntityPlatforms
|
||||
from .helpers.deprecation import (
|
||||
DeprecatedConstant,
|
||||
DeprecatedConstantEnum,
|
||||
EnumWithDeprecatedMembers,
|
||||
all_with_deprecated_constants,
|
||||
@@ -316,60 +315,6 @@ STATE_OK: Final = "ok"
|
||||
STATE_PROBLEM: Final = "problem"
|
||||
|
||||
|
||||
# #### ALARM CONTROL PANEL STATES ####
|
||||
# STATE_ALARM_* below are deprecated as of 2024.11
|
||||
# use the AlarmControlPanelState enum instead.
|
||||
_DEPRECATED_STATE_ALARM_DISARMED: Final = DeprecatedConstant(
|
||||
"disarmed",
|
||||
"AlarmControlPanelState.DISARMED",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_ARMED_HOME: Final = DeprecatedConstant(
|
||||
"armed_home",
|
||||
"AlarmControlPanelState.ARMED_HOME",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_ARMED_AWAY: Final = DeprecatedConstant(
|
||||
"armed_away",
|
||||
"AlarmControlPanelState.ARMED_AWAY",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_ARMED_NIGHT: Final = DeprecatedConstant(
|
||||
"armed_night",
|
||||
"AlarmControlPanelState.ARMED_NIGHT",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_ARMED_VACATION: Final = DeprecatedConstant(
|
||||
"armed_vacation",
|
||||
"AlarmControlPanelState.ARMED_VACATION",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_ARMED_CUSTOM_BYPASS: Final = DeprecatedConstant(
|
||||
"armed_custom_bypass",
|
||||
"AlarmControlPanelState.ARMED_CUSTOM_BYPASS",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_PENDING: Final = DeprecatedConstant(
|
||||
"pending",
|
||||
"AlarmControlPanelState.PENDING",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_ARMING: Final = DeprecatedConstant(
|
||||
"arming",
|
||||
"AlarmControlPanelState.ARMING",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_DISARMING: Final = DeprecatedConstant(
|
||||
"disarming",
|
||||
"AlarmControlPanelState.DISARMING",
|
||||
"2025.11",
|
||||
)
|
||||
_DEPRECATED_STATE_ALARM_TRIGGERED: Final = DeprecatedConstant(
|
||||
"triggered",
|
||||
"AlarmControlPanelState.TRIGGERED",
|
||||
"2025.11",
|
||||
)
|
||||
|
||||
# #### STATE AND EVENT ATTRIBUTES ####
|
||||
# Attribution
|
||||
ATTR_ATTRIBUTION: Final = "attribution"
|
||||
|
||||
@@ -8,13 +8,11 @@ from unittest.mock import Mock, patch
|
||||
import pytest
|
||||
|
||||
from homeassistant import const
|
||||
from homeassistant.components import alarm_control_panel
|
||||
|
||||
from .common import (
|
||||
extract_stack_to_frame,
|
||||
help_test_all,
|
||||
import_and_test_deprecated_constant,
|
||||
import_and_test_deprecated_constant_enum,
|
||||
)
|
||||
|
||||
|
||||
@@ -52,30 +50,6 @@ def test_deprecated_constant_name_changes(
|
||||
)
|
||||
|
||||
|
||||
def _create_tuples_alarm_states(
|
||||
enum: type[Enum], constant_prefix: str, remove_in_version: str
|
||||
) -> list[tuple[Enum, str]]:
|
||||
return [(enum_field, constant_prefix, remove_in_version) for enum_field in enum]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("enum", "constant_prefix", "remove_in_version"),
|
||||
_create_tuples_alarm_states(
|
||||
alarm_control_panel.AlarmControlPanelState, "STATE_ALARM_", "2025.11"
|
||||
),
|
||||
)
|
||||
def test_deprecated_constants_alarm(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
enum: Enum,
|
||||
constant_prefix: str,
|
||||
remove_in_version: str,
|
||||
) -> None:
|
||||
"""Test deprecated constants."""
|
||||
import_and_test_deprecated_constant_enum(
|
||||
caplog, const, enum, constant_prefix, remove_in_version
|
||||
)
|
||||
|
||||
|
||||
def test_deprecated_unit_of_conductivity_alias() -> None:
|
||||
"""Test UnitOfConductivity deprecation."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user