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
13 changes: 7 additions & 6 deletions homeassistant/components/rflink/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

from homeassistant.components.light import (
ATTR_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_ONOFF,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
LightEntity,
)
from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF_TYPE
Expand Down Expand Up @@ -177,6 +178,8 @@ class RflinkLight(SwitchableRflinkDevice, LightEntity):
class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity):
"""Rflink light device that support dimming."""

_attr_color_mode = COLOR_MODE_BRIGHTNESS
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
_brightness = 255

async def async_added_to_hass(self):
Expand Down Expand Up @@ -221,11 +224,6 @@ def brightness(self):
"""Return the brightness of this light between 0..255."""
return self._brightness

@property
def supported_features(self):
"""Flag supported features."""
return SUPPORT_BRIGHTNESS


class HybridRflinkLight(DimmableRflinkLight, LightEntity):
"""Rflink light device that sends out both dim and on/off commands.
Expand Down Expand Up @@ -260,6 +258,9 @@ class ToggleRflinkLight(SwitchableRflinkDevice, LightEntity):
and if the light is off and 'on' gets sent, the light will turn on.
"""

_attr_color_mode = COLOR_MODE_ONOFF
_attr_supported_color_modes = {COLOR_MODE_ONOFF}

def _handle_event(self, event):
"""Adjust state if Rflink picks up a remote command for this device."""
self.cancel_queued_send_commands()
Expand Down