From 19b08a975abbaaecc26f734faed0dd51cbcb6d74 Mon Sep 17 00:00:00 2001 From: John Arild Berentsen Date: Sun, 20 Nov 2016 20:49:54 +0100 Subject: [PATCH 1/2] ZWave lights: Not use super() (#4476) * Not use super * Review changes --- homeassistant/components/light/zwave.py | 2 +- homeassistant/components/zwave/__init__.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/light/zwave.py b/homeassistant/components/light/zwave.py index d4e94b00e66..e1049192f51 100644 --- a/homeassistant/components/light/zwave.py +++ b/homeassistant/components/light/zwave.py @@ -52,7 +52,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): node = zwave.NETWORK.nodes[discovery_info[zwave.const.ATTR_NODE_ID]] value = node.values[discovery_info[zwave.const.ATTR_VALUE_ID]] customize = hass.data['zwave_customize'] - name = super().entity_id + name = '{}.{}'.format(DOMAIN, zwave.object_id(value)) node_config = customize.get(name, {}) refresh = node_config.get(zwave.CONF_REFRESH_VALUE) delay = node_config.get(zwave.CONF_REFRESH_DELAY) diff --git a/homeassistant/components/zwave/__init__.py b/homeassistant/components/zwave/__init__.py index a6294f560be..471b45feed0 100755 --- a/homeassistant/components/zwave/__init__.py +++ b/homeassistant/components/zwave/__init__.py @@ -193,19 +193,19 @@ def _node_object_id(node): return node_object_id -def _object_id(value): +def object_id(value): """Return the object_id of the device value. The object_id contains node_id and value instance id to not collide with other entity_ids. """ - object_id = "{}_{}_{}".format(slugify(_value_name(value)), - value.node.node_id, value.index) + _object_id = "{}_{}_{}".format(slugify(_value_name(value)), + value.node.node_id, value.index) # Add the instance id if there is more than one instance for the value if value.instance > 1: return '{}_{}'.format(object_id, value.instance) - return object_id + return _object_id def nice_print_node(node): @@ -341,7 +341,7 @@ def setup(hass, config): node.generic, node.specific, value.command_class, value.type, value.genre) - name = "{}.{}".format(component, _object_id(value)) + name = "{}.{}".format(component, object_id(value)) node_config = customize.get(name, {}) @@ -594,7 +594,7 @@ class ZWaveDeviceEntity: The object_id contains node_id and value instance id to not collide with other entity_ids. """ - return _object_id(self._value) + return object_id(self._value) @property def device_state_attributes(self): From 99f5db8c02277e20c7f39d1405a0e97307ec6cd0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 20 Nov 2016 12:11:07 -0800 Subject: [PATCH 2/2] Version bump to 0.33.1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index aa1f3654851..21396e52040 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 33 -PATCH_VERSION = '0' +PATCH_VERSION = '1' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2)