Expose the node name on the zwave node entity (#7787)

This commit is contained in:
Adam Mills 2017-06-02 01:33:16 -04:00 committed by Paulus Schoutsen
parent 66d6f5174d
commit e0712ba329
2 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,7 @@ ATTR_READY = 'is_ready'
ATTR_FAILED = 'is_failed'
ATTR_PRODUCT_NAME = 'product_name'
ATTR_MANUFACTURER_NAME = 'manufacturer_name'
ATTR_NODE_NAME = 'node_name'
STAGE_COMPLETE = 'Complete'
@ -165,6 +166,7 @@ class ZWaveNodeEntity(ZWaveBaseEntity):
"""Return the device specific state attributes."""
attrs = {
ATTR_NODE_ID: self.node_id,
ATTR_NODE_NAME: self._name,
ATTR_MANUFACTURER_NAME: self._manufacturer_name,
ATTR_PRODUCT_NAME: self._product_name,
}

View File

@ -83,6 +83,7 @@ class TestZWaveNodeEntity(unittest.TestCase):
self.maxDiff = None
self.assertEqual(
{'node_id': self.node.node_id,
'node_name': 'Mock Node',
'manufacturer_name': 'Test Manufacturer',
'product_name': 'Test Product'},
self.entity.device_state_attributes)
@ -140,6 +141,7 @@ class TestZWaveNodeEntity(unittest.TestCase):
self.entity.node_changed()
self.assertEqual(
{'node_id': self.node.node_id,
'node_name': 'Mock Node',
'manufacturer_name': 'Test Manufacturer',
'product_name': 'Test Product',
'query_stage': 'Dynamic',