mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 06:05:26 +01:00
Cleanup deprecated COLOR_MODE light constants (#162197)
This commit is contained in:
@@ -82,26 +82,6 @@ ATTR_COLOR_MODE = "color_mode"
|
||||
# List of color modes supported by the light
|
||||
ATTR_SUPPORTED_COLOR_MODES = "supported_color_modes"
|
||||
|
||||
# These COLOR_MODE_* constants are deprecated as of Home Assistant 2022.5.
|
||||
# Please use the LightEntityFeature enum instead.
|
||||
_DEPRECATED_COLOR_MODE_UNKNOWN: Final = DeprecatedConstantEnum(
|
||||
ColorMode.UNKNOWN, "2026.1"
|
||||
)
|
||||
_DEPRECATED_COLOR_MODE_ONOFF: Final = DeprecatedConstantEnum(ColorMode.ONOFF, "2026.1")
|
||||
_DEPRECATED_COLOR_MODE_BRIGHTNESS: Final = DeprecatedConstantEnum(
|
||||
ColorMode.BRIGHTNESS, "2026.1"
|
||||
)
|
||||
_DEPRECATED_COLOR_MODE_COLOR_TEMP: Final = DeprecatedConstantEnum(
|
||||
ColorMode.COLOR_TEMP, "2026.1"
|
||||
)
|
||||
_DEPRECATED_COLOR_MODE_HS: Final = DeprecatedConstantEnum(ColorMode.HS, "2026.1")
|
||||
_DEPRECATED_COLOR_MODE_XY: Final = DeprecatedConstantEnum(ColorMode.XY, "2026.1")
|
||||
_DEPRECATED_COLOR_MODE_RGB: Final = DeprecatedConstantEnum(ColorMode.RGB, "2026.1")
|
||||
_DEPRECATED_COLOR_MODE_RGBW: Final = DeprecatedConstantEnum(ColorMode.RGBW, "2026.1")
|
||||
_DEPRECATED_COLOR_MODE_RGBWW: Final = DeprecatedConstantEnum(ColorMode.RGBWW, "2026.1")
|
||||
_DEPRECATED_COLOR_MODE_WHITE: Final = DeprecatedConstantEnum(ColorMode.WHITE, "2026.1")
|
||||
|
||||
|
||||
# mypy: disallow-any-generics
|
||||
|
||||
|
||||
|
||||
@@ -1794,11 +1794,11 @@ async def test_get_light_state_when_none(
|
||||
light.ATTR_COLOR_TEMP_KELVIN: None,
|
||||
light.ATTR_XY_COLOR: None,
|
||||
light.ATTR_SUPPORTED_COLOR_MODES: [
|
||||
light.COLOR_MODE_COLOR_TEMP,
|
||||
light.COLOR_MODE_HS,
|
||||
light.COLOR_MODE_XY,
|
||||
light.ColorMode.COLOR_TEMP,
|
||||
light.ColorMode.HS,
|
||||
light.ColorMode.XY,
|
||||
],
|
||||
light.ATTR_COLOR_MODE: light.COLOR_MODE_XY,
|
||||
light.ATTR_COLOR_MODE: light.ColorMode.XY,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -1822,11 +1822,11 @@ async def test_get_light_state_when_none(
|
||||
light.ATTR_COLOR_TEMP_KELVIN: None,
|
||||
light.ATTR_XY_COLOR: None,
|
||||
light.ATTR_SUPPORTED_COLOR_MODES: [
|
||||
light.COLOR_MODE_COLOR_TEMP,
|
||||
light.COLOR_MODE_HS,
|
||||
light.COLOR_MODE_XY,
|
||||
light.ColorMode.COLOR_TEMP,
|
||||
light.ColorMode.HS,
|
||||
light.ColorMode.XY,
|
||||
],
|
||||
light.ATTR_COLOR_MODE: light.COLOR_MODE_XY,
|
||||
light.ATTR_COLOR_MODE: light.ColorMode.XY,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -2914,17 +2914,3 @@ def test_deprecated_support_light_constants_enums(
|
||||
import_and_test_deprecated_constant_enum(
|
||||
caplog, light, entity_feature, "SUPPORT_", "2026.1"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"entity_feature",
|
||||
list(light.ColorMode),
|
||||
)
|
||||
def test_deprecated_color_mode_constants_enums(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
entity_feature: light.LightEntityFeature,
|
||||
) -> None:
|
||||
"""Test deprecated support light constants."""
|
||||
import_and_test_deprecated_constant_enum(
|
||||
caplog, light, entity_feature, "COLOR_MODE_", "2026.1"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user