Skip to content

Commit

Permalink
Do not call update() in constructor (#8247)
Browse files Browse the repository at this point in the history
Add an optional extended description…
  • Loading branch information
fabaff authored and pvizeli committed Jun 29, 2017
1 parent a9f14b6 commit 0f12b4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions homeassistant/components/binary_sensor/arest.py
Expand Up @@ -51,7 +51,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):

add_devices([ArestBinarySensor(
arest, resource, config.get(CONF_NAME, response[CONF_NAME]),
device_class, pin)])
device_class, pin)], True)


class ArestBinarySensor(BinarySensorDevice):
Expand All @@ -64,7 +64,6 @@ def __init__(self, arest, resource, name, device_class, pin):
self._name = name
self._device_class = device_class
self._pin = pin
self.update()

if self._pin is not None:
request = requests.get(
Expand Down
3 changes: 1 addition & 2 deletions homeassistant/components/sensor/arest.py
Expand Up @@ -102,7 +102,7 @@ def _render(value):
pin=pinnum, unit_of_measurement=pin.get(
CONF_UNIT_OF_MEASUREMENT), renderer=renderer))

add_devices(dev)
add_devices(dev, True)


class ArestSensor(Entity):
Expand All @@ -119,7 +119,6 @@ def __init__(self, arest, resource, location, name, variable=None,
self._state = STATE_UNKNOWN
self._unit_of_measurement = unit_of_measurement
self._renderer = renderer
self.update()

if self._pin is not None:
request = requests.get(
Expand Down

0 comments on commit 0f12b4c

Please sign in to comment.