mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Ensure entity platform in light tests (#135787)
This commit is contained in:
parent
619917c679
commit
88c3be4ecf
@ -2626,7 +2626,9 @@ def test_filter_supported_color_modes() -> None:
|
|||||||
assert light.filter_supported_color_modes(supported) == {light.ColorMode.BRIGHTNESS}
|
assert light.filter_supported_color_modes(supported) == {light.ColorMode.BRIGHTNESS}
|
||||||
|
|
||||||
|
|
||||||
def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) -> None:
|
def test_deprecated_supported_features_ints(
|
||||||
|
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||||
|
) -> None:
|
||||||
"""Test deprecated supported features ints."""
|
"""Test deprecated supported features ints."""
|
||||||
|
|
||||||
class MockLightEntityEntity(light.LightEntity):
|
class MockLightEntityEntity(light.LightEntity):
|
||||||
@ -2636,6 +2638,8 @@ def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) ->
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
entity = MockLightEntityEntity()
|
entity = MockLightEntityEntity()
|
||||||
|
entity.hass = hass
|
||||||
|
entity.platform = MockEntityPlatform(hass, domain="test", platform_name="test")
|
||||||
assert entity.supported_features_compat is light.LightEntityFeature(1)
|
assert entity.supported_features_compat is light.LightEntityFeature(1)
|
||||||
assert "MockLightEntityEntity" in caplog.text
|
assert "MockLightEntityEntity" in caplog.text
|
||||||
assert "is using deprecated supported features values" in caplog.text
|
assert "is using deprecated supported features values" in caplog.text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user