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

@@ -49,11 +49,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
_LOGGER.debug("Probing for access to ELIQ Online API")
api.get_data_now(channelid=channel_id)
except OSError as error:
_LOGGER.error("Could not access the ELIQ Online API. "
"Is the configuration valid? %s", error)
_LOGGER.error("Could not access the ELIQ Online API: %s", error)
return False
add_devices([EliqSensor(api, channel_id, name)])
add_devices([EliqSensor(api, channel_id, name)], True)
class EliqSensor(Entity):
@@ -65,7 +64,6 @@ class EliqSensor(Entity):
self._state = STATE_UNKNOWN
self._api = api
self._channel_id = channel_id
self.update()
@property
def name(self):