Merge pull request #1108 from lukas-hetzenecker/regression-zwave-light

Z-Wave Regression: Fix state attributes of lights and switches.
This commit is contained in:
Paulus Schoutsen 2016-02-03 21:25:13 -08:00
commit a33f1c61e5
2 changed files with 7 additions and 2 deletions

View File

@ -111,6 +111,11 @@ class ZWaveSensor(ZWaveDeviceEntity, Entity):
""" Returns the state of the sensor. """
return self._value.data
@property
def state_attributes(self):
""" Returns optional state attributes. """
return self.device_state_attributes
@property
def unit_of_measurement(self):
return self._value.units

View File

@ -255,8 +255,8 @@ class ZWaveDeviceEntity:
return object_id
@property
def state_attributes(self):
""" Returns the state attributes. """
def device_state_attributes(self):
""" Returns device specific state attributes. """
attrs = {
ATTR_NODE_ID: self._value.node.node_id,
}