add dimmer slide control to imported isy lights (#4152)

Supported attribute added and checks appear to pass. 🐬
This commit is contained in:
jbcodemonkey 2016-11-04 17:28:22 -04:00 committed by Teagan Glenn
parent 18e965c3cd
commit a3db0ec231

View File

@ -7,7 +7,8 @@ https://home-assistant.io/components/light.isy994/
import logging
from typing import Callable
from homeassistant.components.light import Light, SUPPORT_BRIGHTNESS
from homeassistant.components.light import (
Light, SUPPORT_BRIGHTNESS, ATTR_BRIGHTNESS)
import homeassistant.components.isy994 as isy
from homeassistant.const import STATE_ON, STATE_OFF, STATE_UNKNOWN
from homeassistant.helpers.typing import ConfigType
@ -68,6 +69,11 @@ class ISYLightDevice(isy.ISYDevice, Light):
if not self._node.on(val=brightness):
_LOGGER.debug('Unable to turn on light.')
@property
def state_attributes(self):
"""Flag supported attributes."""
return {ATTR_BRIGHTNESS: self.value}
@property
def supported_features(self):
"""Flag supported features."""