Migrate modbus light to color_mode (#69426)
This commit is contained in:
parent
def305cf46
commit
181142aae7
1 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.light import LightEntity
|
||||
from homeassistant.components.light import COLOR_MODE_ONOFF, LightEntity
|
||||
from homeassistant.const import CONF_LIGHTS, CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -36,6 +36,9 @@ async def async_setup_platform(
|
|||
class ModbusLight(BaseSwitch, LightEntity):
|
||||
"""Class representing a Modbus light."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_ONOFF
|
||||
_attr_supported_color_modes = {COLOR_MODE_ONOFF}
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Set light on."""
|
||||
await self.async_turn(self.command_on)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue