Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions homeassistant/components/zwave_me/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from zwave_me_ws import ZWaveMeData

from homeassistant.components.light import ATTR_RGB_COLOR, COLOR_MODE_RGB, LightEntity
from homeassistant.components.light import ATTR_RGB_COLOR, ColorMode, LightEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
Expand Down Expand Up @@ -45,6 +45,9 @@ def add_new_device(new_device: ZWaveMeData) -> None:
class ZWaveMeRGB(ZWaveMeEntity, LightEntity):
"""Representation of a ZWaveMe light."""

_attr_supported_color_modes = {ColorMode.RGB}
_attr_color_mode = ColorMode.RGB

def turn_off(self, **kwargs: Any) -> None:
"""Turn the device on."""
self.controller.zwave_api.send_command(self.device.id, "off")
Expand Down Expand Up @@ -73,13 +76,3 @@ def rgb_color(self) -> tuple[int, int, int]:
"""Return the rgb color value [int, int, int]."""
rgb = self.device.color
return rgb["r"], rgb["g"], rgb["b"]

@property
def supported_color_modes(self) -> set:
"""Return all color modes."""
return {COLOR_MODE_RGB}

@property
def color_mode(self) -> str:
"""Return current color mode."""
return COLOR_MODE_RGB