Remove Z-Wave old/new entity_id attributes (#12652)

This commit is contained in:
Adam Mills authored and GitHub committed 2018-03-11 10:30:03 -04:00
1 parent f164a5a65f
commit dc8424032b
5 files changed
+19 -98

No files matched your search

+2 -12
View File
@@ -4,11 +4,10 @@ import logging
from homeassistant.core import callback
from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_WAKEUP, ATTR_ENTITY_ID
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify
from .const import (
ATTR_NODE_ID, COMMAND_CLASS_WAKE_UP, ATTR_SCENE_ID, ATTR_SCENE_DATA,
ATTR_BASIC_LEVEL, EVENT_NODE_EVENT, EVENT_SCENE_ACTIVATED, DOMAIN,
ATTR_BASIC_LEVEL, EVENT_NODE_EVENT, EVENT_SCENE_ACTIVATED,
COMMAND_CLASS_CENTRAL_SCENE)
from .util import node_name
@@ -41,8 +40,6 @@ class ZWaveBaseEntity(Entity):
def __init__(self):
"""Initialize the base Z-Wave class."""
self._update_scheduled = False
self.old_entity_id = None
self.new_entity_id = None
def maybe_schedule_update(self):
"""Maybe schedule state update.
@@ -72,7 +69,7 @@ class ZWaveBaseEntity(Entity):
class ZWaveNodeEntity(ZWaveBaseEntity):
"""Representation of a Z-Wave node."""
def __init__(self, node, network, new_entity_ids):
def __init__(self, node, network):
"""Initialize node."""
# pylint: disable=import-error
super().__init__()
@@ -84,11 +81,6 @@ class ZWaveNodeEntity(ZWaveBaseEntity):
self._name = node_name(self.node)
self._product_name = node.product_name
self._manufacturer_name = node.manufacturer_name
self.old_entity_id = "{}.{}_{}".format(
DOMAIN, slugify(self._name), self.node_id)
self.new_entity_id = "{}.{}".format(DOMAIN, slugify(self._name))
if not new_entity_ids:
self.entity_id = self.old_entity_id
self._attributes = {}
self.wakeup_interval = None
self.location = None
@@ -229,8 +221,6 @@ class ZWaveNodeEntity(ZWaveBaseEntity):
ATTR_NODE_NAME: self._name,
ATTR_MANUFACTURER_NAME: self._manufacturer_name,
ATTR_PRODUCT_NAME: self._product_name,
'old_entity_id': self.old_entity_id,
'new_entity_id': self.new_entity_id,
}
attrs.update(self._attributes)
if self.battery_level is not None: