cleanup
This commit is contained in:
parent
a1d5daee53
commit
7c69941f13
1 changed files with 1 additions and 4 deletions
|
@ -47,8 +47,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
|
||||||
_LOGGER.debug("Rain Bird Controller set to " + str(server))
|
_LOGGER.debug("Rain Bird Controller set to " + str(server))
|
||||||
|
|
||||||
initialstatus = controller.currentIrrigation()
|
if controller.currentIrrigation() == -1:
|
||||||
if initialstatus == -1:
|
|
||||||
_LOGGER.error("Error getting state. Possible configuration issues")
|
_LOGGER.error("Error getting state. Possible configuration issues")
|
||||||
raise PlatformNotReady
|
raise PlatformNotReady
|
||||||
else:
|
else:
|
||||||
|
@ -89,12 +88,10 @@ class RainBirdSwitch(SwitchDevice):
|
||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
"""Turn the switch on."""
|
"""Turn the switch on."""
|
||||||
self._state = True
|
|
||||||
self._rainbird.startIrrigation(int(self._zone), int(self._duration))
|
self._rainbird.startIrrigation(int(self._zone), int(self._duration))
|
||||||
|
|
||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
"""Turn the switch off."""
|
"""Turn the switch off."""
|
||||||
self._state = False
|
|
||||||
self._rainbird.stopIrrigation()
|
self._rainbird.stopIrrigation()
|
||||||
|
|
||||||
def get_device_status(self):
|
def get_device_status(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue