Use ColorMode enum in switch_as_x (#70538)
This commit is contained in:
parent
9c42443910
commit
23974eed41
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
"""Light support for switch entities."""
|
"""Light support for switch entities."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.light import COLOR_MODE_ONOFF, LightEntity
|
from homeassistant.components.light import ColorMode, LightEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_ENTITY_ID
|
from homeassistant.const import CONF_ENTITY_ID
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -39,5 +39,5 @@ async def async_setup_entry(
|
||||||
class LightSwitch(BaseToggleEntity, LightEntity):
|
class LightSwitch(BaseToggleEntity, LightEntity):
|
||||||
"""Represents a Switch as a Light."""
|
"""Represents a Switch as a Light."""
|
||||||
|
|
||||||
_attr_color_mode = COLOR_MODE_ONOFF
|
_attr_color_mode = ColorMode.ONOFF
|
||||||
_attr_supported_color_modes = {COLOR_MODE_ONOFF}
|
_attr_supported_color_modes = {ColorMode.ONOFF}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue