diff --git a/homeassistant/components/isy994.py b/homeassistant/components/isy994.py index 7451b3286f7..cbe7c7166e7 100644 --- a/homeassistant/components/isy994.py +++ b/homeassistant/components/isy994.py @@ -228,10 +228,6 @@ class ISYDevice(Entity): self._change_handler = self._node.status.subscribe('changed', self.on_update) - def __del__(self) -> None: - """Cleanup the subscriptions.""" - self._change_handler.unsubscribe() - # pylint: disable=unused-argument def on_update(self, event: object) -> None: """Handle the update event from the ISY994 Node.""" @@ -272,7 +268,7 @@ class ISYDevice(Entity): return self._node.status._val @property - def state_attributes(self) -> Dict: + def device_state_attributes(self) -> Dict: """Get the state attributes for the device.""" attr = {} if hasattr(self._node, 'aux_properties'): diff --git a/homeassistant/components/light/isy994.py b/homeassistant/components/light/isy994.py index 952c52b2809..1cde50de820 100644 --- a/homeassistant/components/light/isy994.py +++ b/homeassistant/components/light/isy994.py @@ -8,18 +8,13 @@ import logging from typing import Callable from homeassistant.components.light import ( - Light, SUPPORT_BRIGHTNESS, ATTR_BRIGHTNESS) + Light, SUPPORT_BRIGHTNESS) import homeassistant.components.isy994 as isy -from homeassistant.const import STATE_ON, STATE_OFF, STATE_UNKNOWN +from homeassistant.const import STATE_ON, STATE_OFF from homeassistant.helpers.typing import ConfigType _LOGGER = logging.getLogger(__name__) -VALUE_TO_STATE = { - False: STATE_OFF, - True: STATE_ON, -} - UOM = ['2', '51', '78'] STATES = [STATE_OFF, STATE_ON, 'true', 'false', '%'] @@ -52,12 +47,12 @@ class ISYLightDevice(isy.ISYDevice, Light): @property def is_on(self) -> bool: """Get whether the ISY994 light is on.""" - return self.state == STATE_ON + return self.value > 0 @property - def state(self) -> str: - """Get the state of the ISY994 light.""" - return VALUE_TO_STATE.get(bool(self.value), STATE_UNKNOWN) + def brightness(self) -> float: + """Get the brightness of the ISY994 light.""" + return self.value def turn_off(self, **kwargs) -> None: """Send the turn off command to the ISY994 light device.""" @@ -69,11 +64,6 @@ 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."""