mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Remove use of deprecated constants from evil_genius_labs light (#69183)
This commit is contained in:
parent
2ce8c97ebd
commit
24754c31ca
@ -31,9 +31,7 @@ async def async_setup_entry(
|
|||||||
class EvilGeniusLight(EvilGeniusEntity, light.LightEntity):
|
class EvilGeniusLight(EvilGeniusEntity, light.LightEntity):
|
||||||
"""Evil Genius Labs light."""
|
"""Evil Genius Labs light."""
|
||||||
|
|
||||||
_attr_supported_features = (
|
_attr_supported_features = light.SUPPORT_EFFECT
|
||||||
light.SUPPORT_BRIGHTNESS | light.SUPPORT_EFFECT | light.SUPPORT_COLOR
|
|
||||||
)
|
|
||||||
_attr_supported_color_modes = {light.COLOR_MODE_RGB}
|
_attr_supported_color_modes = {light.COLOR_MODE_RGB}
|
||||||
_attr_color_mode = light.COLOR_MODE_RGB
|
_attr_color_mode = light.COLOR_MODE_RGB
|
||||||
|
|
||||||
|
@ -3,6 +3,14 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from homeassistant.components.light import (
|
||||||
|
ATTR_COLOR_MODE,
|
||||||
|
ATTR_SUPPORTED_COLOR_MODES,
|
||||||
|
COLOR_MODE_RGB,
|
||||||
|
SUPPORT_EFFECT,
|
||||||
|
)
|
||||||
|
from homeassistant.const import ATTR_SUPPORTED_FEATURES
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("platforms", [("light",)])
|
@pytest.mark.parametrize("platforms", [("light",)])
|
||||||
async def test_works(hass, setup_evil_genius_labs):
|
async def test_works(hass, setup_evil_genius_labs):
|
||||||
@ -11,6 +19,9 @@ async def test_works(hass, setup_evil_genius_labs):
|
|||||||
assert state is not None
|
assert state is not None
|
||||||
assert state.state == "on"
|
assert state.state == "on"
|
||||||
assert state.attributes["brightness"] == 128
|
assert state.attributes["brightness"] == 128
|
||||||
|
assert state.attributes[ATTR_COLOR_MODE] == COLOR_MODE_RGB
|
||||||
|
assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == [COLOR_MODE_RGB]
|
||||||
|
assert state.attributes[ATTR_SUPPORTED_FEATURES] == SUPPORT_EFFECT
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("platforms", [("light",)])
|
@pytest.mark.parametrize("platforms", [("light",)])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user