Add product_name attribute to zwave nodes. (#7071)

This commit is contained in:
Andrey authored and GitHub committed 2017-04-12 21:12:37 +03:00
1 parent d63028e44a
commit 5e18c997f7
2 files changed
+11 -2

No files matched your search

@@ -15,6 +15,7 @@ ATTR_QUERY_STAGE = 'query_stage'
ATTR_AWAKE = 'is_awake'
ATTR_READY = 'is_ready'
ATTR_FAILED = 'is_failed'
ATTR_PRODUCT_NAME = 'product_name'
STAGE_COMPLETE = 'Complete'
@@ -79,6 +80,8 @@ class ZWaveNodeEntity(ZWaveBaseEntity):
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 @@ class ZWaveNodeEntity(ZWaveBaseEntity):
"""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: