diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index e529327f505..099c23973f0 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -12,6 +12,7 @@ from datetime import timedelta from homeassistant.loader import get_component from homeassistant.helpers import validate_config +from homeassistant.helpers.entity import _OVERWRITE import homeassistant.util as util import homeassistant.util.dt as dt_util @@ -162,9 +163,12 @@ class DeviceTracker(object): state = STATE_HOME if is_home else STATE_NOT_HOME + # overwrite properties that have been set in the config file + attr = dict(dev_info['state_attr']) + attr.update(_OVERWRITE.get(dev_info['entity_id'], {})) + self.hass.states.set( - dev_info['entity_id'], state, - dev_info['state_attr']) + dev_info['entity_id'], state, attr) def update_devices(self, now): """ Update device states based on the found devices. """ diff --git a/homeassistant/components/isy994.py b/homeassistant/components/isy994.py index 5cdfbe1b277..ad165d64d6c 100644 --- a/homeassistant/components/isy994.py +++ b/homeassistant/components/isy994.py @@ -156,6 +156,11 @@ class ISYDeviceABC(ToggleEntity): attr = {ATTR_FRIENDLY_NAME: self.name} for name, prop in self._attrs.items(): attr[name] = getattr(self, prop) + attr = self._attr_filter(attr) + return attr + + def _attr_filter(self, attr): + """ Placeholder for attribute filters. """ return attr @property diff --git a/homeassistant/components/light/isy994.py b/homeassistant/components/light/isy994.py index b231fe3e441..5b62120ee98 100644 --- a/homeassistant/components/light/isy994.py +++ b/homeassistant/components/light/isy994.py @@ -38,3 +38,9 @@ class ISYLightDevice(ISYDeviceABC): _attrs = {ATTR_BRIGHTNESS: 'value'} _onattrs = [ATTR_BRIGHTNESS] _states = [STATE_ON, STATE_OFF] + + def _attr_filter(self, attr): + """ Filter brightness out of entity while off. """ + if ATTR_BRIGHTNESS in attr and not self.is_on: + del attr[ATTR_BRIGHTNESS] + return attr