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
18 changes: 6 additions & 12 deletions homeassistant/components/scsgate/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from scsgate.tasks import ToggleStatusTask
import voluptuous as vol

from homeassistant.components.light import PLATFORM_SCHEMA, LightEntity
from homeassistant.components.light import PLATFORM_SCHEMA, ColorMode, LightEntity
from homeassistant.const import ATTR_ENTITY_ID, ATTR_STATE, CONF_DEVICES, CONF_NAME
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
Expand Down Expand Up @@ -54,9 +54,13 @@ def setup_platform(
class SCSGateLight(LightEntity):
"""Representation of a SCSGate light."""

_attr_color_mode = ColorMode.ONOFF
_attr_supported_color_modes = {ColorMode.ONOFF}
_attr_should_poll = False

def __init__(self, scs_id, name, logger, scsgate):
"""Initialize the light."""
self._name = name
self._attr_name = name
self._scs_id = scs_id
self._toggled = False
self._logger = logger
Expand All @@ -67,16 +71,6 @@ def scs_id(self):
"""Return the SCS ID."""
return self._scs_id

@property
def should_poll(self):
"""No polling needed for a SCSGate light."""
return False

@property
def name(self):
"""Return the name of the device if any."""
return self._name

@property
def is_on(self):
"""Return true if light is on."""
Expand Down