mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Use ColorMode enum in modbus (#70522)
This commit is contained in:
parent
e40b4bee2d
commit
a2bf33e74c
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.light import COLOR_MODE_ONOFF, LightEntity
|
from homeassistant.components.light import ColorMode, LightEntity
|
||||||
from homeassistant.const import CONF_LIGHTS, CONF_NAME
|
from homeassistant.const import CONF_LIGHTS, CONF_NAME
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -36,8 +36,8 @@ async def async_setup_platform(
|
|||||||
class ModbusLight(BaseSwitch, LightEntity):
|
class ModbusLight(BaseSwitch, LightEntity):
|
||||||
"""Class representing a Modbus light."""
|
"""Class representing a Modbus 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}
|
||||||
|
|
||||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Set light on."""
|
"""Set light on."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user