mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 19:48:23 +00:00
Removed some whitelines
Removed some whitelines
This commit is contained in:
parent
c286e2c434
commit
c4f4e492e5
@ -19,18 +19,18 @@ STATE_VAR='rainbird.activestation'
|
|||||||
|
|
||||||
|
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
|
|
||||||
server = config[DOMAIN].get('stickip')
|
server = config[DOMAIN].get('stickip')
|
||||||
password = config[DOMAIN].get('password')
|
password = config[DOMAIN].get('password')
|
||||||
totalstations= config[DOMAIN].get('totalstations')
|
totalstations= config[DOMAIN].get('totalstations')
|
||||||
|
|
||||||
# RainbirdSetup
|
# RainbirdSetup
|
||||||
from pyrainbird import RainbirdController
|
from pyrainbird import RainbirdController
|
||||||
|
|
||||||
controller = RainbirdController(_LOGGER)
|
controller = RainbirdController(_LOGGER)
|
||||||
controller.setConfig(server,password)
|
controller.setConfig(server,password)
|
||||||
_LOGGER.info("Rainbird Controller setup to " + str(server))
|
_LOGGER.info("Rainbird Controller setup to " + str(server))
|
||||||
|
|
||||||
def startirrigation(call):
|
def startirrigation(call):
|
||||||
station_id=call.data.get('station')
|
station_id=call.data.get('station')
|
||||||
duration=call.data.get('duration')
|
duration=call.data.get('duration')
|
||||||
@ -42,7 +42,7 @@ def setup(hass, config):
|
|||||||
_LOGGER.error("Error sending request")
|
_LOGGER.error("Error sending request")
|
||||||
else:
|
else:
|
||||||
_LOGGER.error("Request was not acknowledged!")
|
_LOGGER.error("Request was not acknowledged!")
|
||||||
|
|
||||||
def stopirrigation(call):
|
def stopirrigation(call):
|
||||||
_LOGGER.info("Stop request irrigation")
|
_LOGGER.info("Stop request irrigation")
|
||||||
result = controller.stopIrrigation()
|
result = controller.stopIrrigation()
|
||||||
@ -53,7 +53,7 @@ def setup(hass, config):
|
|||||||
_LOGGER.error("Error sending request")
|
_LOGGER.error("Error sending request")
|
||||||
else:
|
else:
|
||||||
_LOGGER.error("Request was not acknowledged!")
|
_LOGGER.error("Request was not acknowledged!")
|
||||||
|
|
||||||
def getirrigation():
|
def getirrigation():
|
||||||
_LOGGER.info("Request irrigation state")
|
_LOGGER.info("Request irrigation state")
|
||||||
result=controller.currentIrrigation()
|
result=controller.currentIrrigation()
|
||||||
@ -69,10 +69,10 @@ def setup(hass, config):
|
|||||||
hass.services.register(DOMAIN, 'stop_irrigation', stopirrigation)
|
hass.services.register(DOMAIN, 'stop_irrigation', stopirrigation)
|
||||||
|
|
||||||
helpers.event.track_time_change(hass, lambda _: hass.states.set(STATE_VAR, getirrigation()), year=None, month=None, day=None, hour=None, minute=None, second=[00,30])
|
helpers.event.track_time_change(hass, lambda _: hass.states.set(STATE_VAR, getirrigation()), year=None, month=None, day=None, hour=None, minute=None, second=[00,30])
|
||||||
|
|
||||||
|
|
||||||
_LOGGER.info("Initialized Rainbird Controller")
|
_LOGGER.info("Initialized Rainbird Controller")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class Rainbird(Entity):
|
class Rainbird(Entity):
|
||||||
@ -81,7 +81,7 @@ class Rainbird(Entity):
|
|||||||
def __init__(self,hass,stationid,name):
|
def __init__(self,hass,stationid,name):
|
||||||
self._id=stationid
|
self._id=stationid
|
||||||
self._name=name
|
self._name=name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
return True
|
return True
|
||||||
@ -89,10 +89,10 @@ class Rainbird(Entity):
|
|||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
return self_state
|
return self_state
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
def id(self):
|
def id(self):
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user