Deprecate deprecated switch constants (#106225)

This commit is contained in:
Robert Resch 2023-12-22 11:23:21 +01:00 committed by GitHub
parent 06220849fc
commit 4d5bea7bcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 3 deletions

View file

@ -9,7 +9,7 @@ from homeassistant.setup import async_setup_component
from . import common
from tests.common import MockUser
from tests.common import MockUser, import_and_test_deprecated_constant_enum
@pytest.fixture(autouse=True)
@ -80,3 +80,14 @@ async def test_switch_context(
assert state2 is not None
assert state.state != state2.state
assert state2.context.user_id == hass_admin_user.id
@pytest.mark.parametrize(("enum"), list(switch.SwitchDeviceClass))
def test_deprecated_constants(
caplog: pytest.LogCaptureFixture,
enum: switch.SwitchDeviceClass,
) -> None:
"""Test deprecated constants."""
import_and_test_deprecated_constant_enum(
caplog, switch, enum, "DEVICE_CLASS_", "2025.1"
)