Remove use of deprecated constants from evil_genius_labs light (#69183)
parent
2ce8c97ebd
commit
24754c31ca
|
@ -31,9 +31,7 @@ async def async_setup_entry(
|
|||
class EvilGeniusLight(EvilGeniusEntity, light.LightEntity):
|
||||
"""Evil Genius Labs light."""
|
||||
|
||||
_attr_supported_features = (
|
||||
light.SUPPORT_BRIGHTNESS | light.SUPPORT_EFFECT | light.SUPPORT_COLOR
|
||||
)
|
||||
_attr_supported_features = light.SUPPORT_EFFECT
|
||||
_attr_supported_color_modes = {light.COLOR_MODE_RGB}
|
||||
_attr_color_mode = light.COLOR_MODE_RGB
|
||||
|
||||
|
|
|
@ -3,6 +3,14 @@ from unittest.mock import patch
|
|||
|
||||
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",)])
|
||||
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.state == "on"
|
||||
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",)])
|
||||
|
|
Loading…
Reference in New Issue