diff --git a/homeassistant/components/zwave/node_entity.py b/homeassistant/components/zwave/node_entity.py index d0c75dd0b73a4..01c9e39ac5ebb 100644 --- a/homeassistant/components/zwave/node_entity.py +++ b/homeassistant/components/zwave/node_entity.py @@ -15,6 +15,7 @@ ATTR_AWAKE = 'is_awake' ATTR_READY = 'is_ready' ATTR_FAILED = 'is_failed' +ATTR_PRODUCT_NAME = 'product_name' STAGE_COMPLETE = 'Complete' @@ -79,6 +80,8 @@ def __init__(self, node, network): self.node = node self.node_id = self.node.node_id self._name = node_name(self.node) + self._product_name = '{} {}'.format( + node.manufacturer_name, node.product_name) self.entity_id = "{}.{}_{}".format( DOMAIN, slugify(self._name), self.node_id) self._attributes = {} @@ -160,6 +163,7 @@ def device_state_attributes(self): """Return the device specific state attributes.""" attrs = { ATTR_NODE_ID: self.node_id, + ATTR_PRODUCT_NAME: self._product_name, } attrs.update(self._attributes) if self.battery_level is not None: diff --git a/tests/components/zwave/test_node_entity.py b/tests/components/zwave/test_node_entity.py index 223f8f8c419aa..0d57a973c312d 100644 --- a/tests/components/zwave/test_node_entity.py +++ b/tests/components/zwave/test_node_entity.py @@ -41,6 +41,8 @@ def setUp(self): query_stage='Dynamic', is_awake=True, is_ready=False, is_failed=False, is_info_received=True, max_baud_rate=40000, is_zwave_plus=False, capabilities=[], neighbors=[], location=None) + self.node.manufacturer_name = 'Test Manufacturer' + self.node.product_name = 'Test Product' self.entity = node_entity.ZWaveNodeEntity(self.node, self.zwave_network) @@ -79,8 +81,10 @@ def test_network_node_changed_from_another_notification(self): def test_node_changed(self): """Test node_changed function.""" self.maxDiff = None - self.assertEqual({'node_id': self.node.node_id}, - self.entity.device_state_attributes) + self.assertEqual( + {'node_id': self.node.node_id, + 'product_name': 'Test Manufacturer Test Product'}, + self.entity.device_state_attributes) self.node.get_values.return_value = { 1: mock_zwave.MockValue(data=1800) @@ -135,6 +139,7 @@ def test_node_changed(self): self.entity.node_changed() self.assertEqual( {'node_id': self.node.node_id, + 'product_name': 'Test Manufacturer Test Product', 'query_stage': 'Dynamic', 'is_awake': True, 'is_ready': False,