Skip to content

Commit bbadd92

Browse files
Remove deprecated square meters constant (home-assistant#155954)
1 parent 6a7de24 commit bbadd92

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

homeassistant/const.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,6 @@ class UnitOfArea(StrEnum):
685685
HECTARES = "ha"
686686

687687

688-
_DEPRECATED_AREA_SQUARE_METERS: Final = DeprecatedConstantEnum(
689-
UnitOfArea.SQUARE_METERS,
690-
"2025.12",
691-
)
692-
"""Deprecated: please use UnitOfArea.SQUARE_METERS"""
693-
694-
695688
# Mass units
696689
class UnitOfMass(StrEnum):
697690
"""Mass units."""

tests/test_const.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,10 @@
11
"""Test const module."""
22

3-
from enum import Enum
4-
5-
import pytest
6-
73
from homeassistant import const
84

9-
from .common import help_test_all, import_and_test_deprecated_constant
10-
11-
12-
def _create_tuples(
13-
value: type[Enum] | list[Enum], constant_prefix: str
14-
) -> list[tuple[Enum, str]]:
15-
return [(enum, constant_prefix) for enum in value]
5+
from .common import help_test_all
166

177

188
def test_all() -> None:
199
"""Test module.__all__ is correctly set."""
2010
help_test_all(const)
21-
22-
23-
@pytest.mark.parametrize(
24-
("replacement", "constant_name", "breaks_in_version"),
25-
[
26-
(const.UnitOfArea.SQUARE_METERS, "AREA_SQUARE_METERS", "2025.12"),
27-
],
28-
)
29-
def test_deprecated_constant_name_changes(
30-
caplog: pytest.LogCaptureFixture,
31-
replacement: Enum,
32-
constant_name: str,
33-
breaks_in_version: str,
34-
) -> None:
35-
"""Test deprecated constants, where the name is not the same as the enum value."""
36-
import_and_test_deprecated_constant(
37-
caplog,
38-
const,
39-
constant_name,
40-
f"{replacement.__class__.__name__}.{replacement.name}",
41-
replacement,
42-
breaks_in_version,
43-
)

0 commit comments

Comments
 (0)