From e548bd5312095e9f7565c25034ceff011e5495d0 Mon Sep 17 00:00:00 2001 From: jbarrancos <31309880+jbarrancos@users.noreply.github.com> Date: Thu, 24 Aug 2017 22:49:54 +0200 Subject: [PATCH] PIP8 Fixes PIP8 Fixes --- homeassistant/components/rainbird.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/homeassistant/components/rainbird.py b/homeassistant/components/rainbird.py index d2b01cee0ae..836b0c69a62 100644 --- a/homeassistant/components/rainbird.py +++ b/homeassistant/components/rainbird.py @@ -1,6 +1,4 @@ -import homeassistant.loader as loader import homeassistant.helpers as helpers -from homeassistant.helpers.entity import Entity import logging @@ -8,21 +6,17 @@ REQUIREMENTS = ['pyrainbird==0.0.7'] # Home Assistant Setup DOMAIN = 'rainbird' - SERVER = '' PASSWORD = '' +STATE_VAR = 'rainbird.activestation' _LOGGER = logging.getLogger(__name__) -STATE_VAR='rainbird.activestation' - - def setup(hass, config): server = config[DOMAIN].get('stickip') password = config[DOMAIN].get('password') - totalstations= config[DOMAIN].get('totalstations') # RainbirdSetup from pyrainbird import RainbirdController @@ -34,12 +28,12 @@ def setup(hass, config): def startirrigation(call): station_id = call.data.get('station') duration = call.data.get('duration') - _LOGGER.info("Requesting irrigation for " +\ - str(station_id) + " duration " + str(duration)) + _LOGGER.info("Requesting irrigation for " + + str(station_id) + " duration " + str(duration)) result = controller.startIrrigation(station_id, duration) if (result == 1): - _LOGGER.info("Irrigation started on "+str(station_id)+\ - " for " + str(duration)) + _LOGGER.info("Irrigation started on " + str(station_id) + + " for " + str(duration)) elif (result == 0): _LOGGER.error("Error sending request") else: @@ -70,11 +64,11 @@ def setup(hass, config): hass.services.register(DOMAIN, 'start_irrigation', startirrigation) 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") return True