Do not call update() in constructor (#8859)

This commit is contained in:
Fabian Affolter authored and Paulus Schoutsen committed 2017-08-06 10:21:55 -07:00
1 parent ac9c1235bb
commit d8ca04a4bc
19 files changed
+43 -57

No files matched your search

@@ -37,7 +37,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
name = config.get(CONF_NAME)
ohmid = config.get(CONF_ID)
add_devices([OhmconnectSensor(name, ohmid)])
add_devices([OhmconnectSensor(name, ohmid)], True)
class OhmconnectSensor(Entity):
@@ -48,7 +48,6 @@ class OhmconnectSensor(Entity):
self._name = name
self._ohmid = ohmid
self._data = {}
self.update()
@property
def name(self):
@@ -80,4 +79,4 @@ class OhmconnectSensor(Entity):
self._data[child.tag] = child.text
except requests.exceptions.ConnectionError:
_LOGGER.error("No route to host/endpoint: %s", url)
self.data = {}
self._data = {}