Fixed some code formatting and added dd-wrt to the readme

This commit is contained in:
jamespcole 2015-03-28 18:43:41 +11:00
parent 7e6af57186
commit fc07032d35

View file

@ -16,6 +16,7 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def get_scanner(hass, config): def get_scanner(hass, config):
""" Validates config and returns a DdWrt scanner. """ """ Validates config and returns a DdWrt scanner. """
if not validate_config(config, if not validate_config(config,
@ -131,8 +132,10 @@ class DdWrtDeviceScanner(object):
def get_ddwrt_data(self, url): def get_ddwrt_data(self, url):
""" Retrieve data from DD-WRT and return parsed result """ """ Retrieve data from DD-WRT and return parsed result """
try: try:
response = requests.get(url, auth=(self.username, response = requests.get(url, auth=(
self.password), timeout=4) self.username,
self.password),
timeout=4)
except requests.exceptions.Timeout: except requests.exceptions.Timeout:
_LOGGER.exception("Connection to the router timed out") _LOGGER.exception("Connection to the router timed out")
return return