Merge pull request #303 from rmkraus/daemon

Updating Daemon Code
This commit is contained in:
Paulus Schoutsen committed 2015-09-01 00:58:03 -07:00
commit c1f172f33a
7 files changed
+221 -198

No files matched your search

+9
View File
@@ -208,6 +208,11 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer):
""" Registers a path wit the server. """
self.paths.append((method, url, callback, require_auth))
def log_message(self, fmt, *args):
""" Redirect built-in log to HA logging """
# pylint: disable=no-self-use
_LOGGER.info(fmt, *args)
# pylint: disable=too-many-public-methods,too-many-locals
class RequestHandler(SimpleHTTPRequestHandler):
@@ -225,6 +230,10 @@ class RequestHandler(SimpleHTTPRequestHandler):
self._session = None
SimpleHTTPRequestHandler.__init__(self, req, client_addr, server)
def log_message(self, fmt, *arguments):
""" Redirect built-in log to HA logging """
_LOGGER.info(fmt, *arguments)
def _handle_request(self, method): # pylint: disable=too-many-branches
""" Does some common checks and calls appropriate method. """
url = urlparse(self.path)