Improved logging message for HTTP and SUN components

This commit is contained in:
Paulus Schoutsen 2014-09-24 21:58:39 -05:00
parent fbc1c21b2a
commit 38ed025ce3
4 changed files with 11 additions and 8 deletions

View File

@ -33,7 +33,7 @@ Installation instructions / Quick-start guide
---------------------------------------------
* The core depends on [PyEphem](http://rhodesmill.org/pyephem/) and [Requests](http://python-requests.org). Depending on the built-in components you would like to use you will need [PHue](https://github.com/studioimaginaire/phue) for Philips Hue support and [PyChromecast](https://github.com/balloob/pychromecast) for Chromecast support. Install these using `pip3 install -r requirements.txt`.
* Clone the repository and pull in the submodules `git clone --recursive https://github.com/balloob/home-assistant.git`
* In the config directory, copy `home-assistant.conf.default` to `home-assistant.conf` and adjust the config values to match your setup.
* In the config directory, copy `home-assistant.conf.example` to `home-assistant.conf` and adjust the config values to match your setup.
* For routers running Tomato you will have to not only setup your host, username and password but also a http_id. The http_id can be retrieved by going to the admin console of your router, view the source of any of the pages and search for `http_id`.
* If you want to use Hue, setup PHue by running `python -m phue --host HUE_BRIDGE_IP_ADDRESS --config-file-path phue.conf` from the commandline inside your config directory and follow the instructions.
* While running the script it will create and maintain a file called `known_devices.csv` which will contain the detected devices. Adjust the track variable for the devices you want the script to act on and restart the script or call the service `device_tracker/reload_devices_csv`.

View File

@ -172,6 +172,7 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer):
self.hass = hass
self.api_password = api_password
self.server_address = server_address
self.logger = logging.getLogger(__name__)
# To store flash messages between sessions
@ -182,7 +183,9 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer):
def start(self):
""" Starts the server. """
self.logger.info("Starting")
self.logger.info(
"Web interface starting at http://{}:{}".format(
*self.server_address))
self.serve_forever()
@ -365,9 +368,9 @@ class RequestHandler(BaseHTTPRequestHandler):
"<head><title>Home Assistant</title>"
"<link rel='stylesheet' type='text/css' "
" href='/static/style.css'>"
"<link rel='shortcut icon' href='/static/favicon.ico' />"
"<link rel='icon' type='image/png' "
" href='/static/favicon-192x192.png' sizes='192x192'>"
"<link rel='shortcut icon' href='/static/favicon.ico' />"
"<link rel='icon' type='image/png' "
" href='/static/favicon-192x192.png' sizes='192x192'>"
"<script src='http://code.jquery.com/jquery-2.1.1.min.js'>"
" </script>"
"<script type='text/javascript' src='/static/script.js'>"

View File

@ -65,7 +65,7 @@ def setup(hass, config):
try:
import ephem
except ImportError:
logger.exception("TrackSun:Error while importing dependency ephem.")
logger.exception("Error while importing dependency ephem.")
return False
sun = ephem.Sun() # pylint: disable=no-member
@ -92,8 +92,8 @@ def setup(hass, config):
next_change = next_rising_dt
logger.info(
"Sun:{}. Next change: {}".format(new_state,
next_change.strftime("%H:%M")))
"{}. Next change: {}".format(new_state,
next_change.strftime("%H:%M")))
state_attributes = {
STATE_ATTR_NEXT_RISING: util.datetime_to_str(next_rising_dt),