Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate modbus light to color_mode #69426

Merged
merged 1 commit into from Apr 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion homeassistant/components/modbus/light.py
Expand Up @@ -3,7 +3,7 @@

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
Expand Down Expand Up @@ -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)