mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Updated the entity names for all z-wave devices.
Z-Wave have a unique node id, this is now added to the entity name. This is a change will break old configs. The Z-Wave entity_id will have to be updated in configurations. The reason for this change is that the old behavior created duplicate entity_ids if you have several similar devices. The order devices is included is not consistent so when the service was restarted the entity ids could change and the configuration for entities will be invalid. There was also inconsistencies between the naming for sensors and switches. (cherry picked from commit 33a78df)
This commit is contained in:
parent
e541b9ba77
commit
1842e5909e
@ -94,9 +94,10 @@ class ZwaveDimmer(Light):
|
||||
@property
|
||||
def name(self):
|
||||
""" Returns the name of the device if any. """
|
||||
name = self._node.name or "{}".format(self._node.product_name)
|
||||
name = self._node.name or "{} {}".format(
|
||||
self._node.manufacturer_name, self._node.product_name)
|
||||
|
||||
return "{}".format(name or self._value.label)
|
||||
return "{} {} {}".format(name, self._node.node_id, self._value.label)
|
||||
|
||||
@property
|
||||
def brightness(self):
|
||||
|
@ -107,7 +107,7 @@ class ZWaveSensor(Entity):
|
||||
name = self._node.name or "{} {}".format(
|
||||
self._node.manufacturer_name, self._node.product_name)
|
||||
|
||||
return "{} {}".format(name, self._value.label)
|
||||
return "{} {} {}".format(name, self._node.node_id, self._value.label)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
|
@ -58,9 +58,10 @@ class ZwaveSwitch(SwitchDevice):
|
||||
@property
|
||||
def name(self):
|
||||
""" Returns the name of the device if any. """
|
||||
name = self._node.name or "{}".format(self._node.product_name)
|
||||
name = self._node.name or "{} {}".format(
|
||||
self._node.manufacturer_name, self._node.product_name)
|
||||
|
||||
return "{}".format(name or self._value.label)
|
||||
return "{} {} {}".format(name, self._node.node_id, self._value.label)
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user