Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pvizeli authored Oct 24, 2017
1 parent a1d5dae commit 7c69941
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions homeassistant/components/switch/rainbird.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):

_LOGGER.debug("Rain Bird Controller set to " + str(server))

initialstatus = controller.currentIrrigation()
if initialstatus == -1:
if controller.currentIrrigation() == -1:
_LOGGER.error("Error getting state. Possible configuration issues")
raise PlatformNotReady
else:
Expand Down Expand Up @@ -89,12 +88,10 @@ def name(self):

def turn_on(self, **kwargs):
"""Turn the switch on."""
self._state = True
self._rainbird.startIrrigation(int(self._zone), int(self._duration))

def turn_off(self, **kwargs):
"""Turn the switch off."""
self._state = False
self._rainbird.stopIrrigation()

def get_device_status(self):
Expand Down

0 comments on commit 7c69941

Please sign in to comment.