mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Improved logging message for HTTP and SUN components
This commit is contained in:
parent
fbc1c21b2a
commit
38ed025ce3
@ -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`.
|
* 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`
|
* 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`.
|
* 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.
|
* 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`.
|
* 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`.
|
||||||
|
@ -172,6 +172,7 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer):
|
|||||||
|
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self.api_password = api_password
|
self.api_password = api_password
|
||||||
|
self.server_address = server_address
|
||||||
self.logger = logging.getLogger(__name__)
|
self.logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# To store flash messages between sessions
|
# To store flash messages between sessions
|
||||||
@ -182,7 +183,9 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer):
|
|||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
""" Starts the server. """
|
""" Starts the server. """
|
||||||
self.logger.info("Starting")
|
self.logger.info(
|
||||||
|
"Web interface starting at http://{}:{}".format(
|
||||||
|
*self.server_address))
|
||||||
|
|
||||||
self.serve_forever()
|
self.serve_forever()
|
||||||
|
|
||||||
@ -365,9 +368,9 @@ class RequestHandler(BaseHTTPRequestHandler):
|
|||||||
"<head><title>Home Assistant</title>"
|
"<head><title>Home Assistant</title>"
|
||||||
"<link rel='stylesheet' type='text/css' "
|
"<link rel='stylesheet' type='text/css' "
|
||||||
" href='/static/style.css'>"
|
" href='/static/style.css'>"
|
||||||
"<link rel='shortcut icon' href='/static/favicon.ico' />"
|
"<link rel='shortcut icon' href='/static/favicon.ico' />"
|
||||||
"<link rel='icon' type='image/png' "
|
"<link rel='icon' type='image/png' "
|
||||||
" href='/static/favicon-192x192.png' sizes='192x192'>"
|
" href='/static/favicon-192x192.png' sizes='192x192'>"
|
||||||
"<script src='http://code.jquery.com/jquery-2.1.1.min.js'>"
|
"<script src='http://code.jquery.com/jquery-2.1.1.min.js'>"
|
||||||
" </script>"
|
" </script>"
|
||||||
"<script type='text/javascript' src='/static/script.js'>"
|
"<script type='text/javascript' src='/static/script.js'>"
|
||||||
|
@ -65,7 +65,7 @@ def setup(hass, config):
|
|||||||
try:
|
try:
|
||||||
import ephem
|
import ephem
|
||||||
except ImportError:
|
except ImportError:
|
||||||
logger.exception("TrackSun:Error while importing dependency ephem.")
|
logger.exception("Error while importing dependency ephem.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
sun = ephem.Sun() # pylint: disable=no-member
|
sun = ephem.Sun() # pylint: disable=no-member
|
||||||
@ -92,8 +92,8 @@ def setup(hass, config):
|
|||||||
next_change = next_rising_dt
|
next_change = next_rising_dt
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"Sun:{}. Next change: {}".format(new_state,
|
"{}. Next change: {}".format(new_state,
|
||||||
next_change.strftime("%H:%M")))
|
next_change.strftime("%H:%M")))
|
||||||
|
|
||||||
state_attributes = {
|
state_attributes = {
|
||||||
STATE_ATTR_NEXT_RISING: util.datetime_to_str(next_rising_dt),
|
STATE_ATTR_NEXT_RISING: util.datetime_to_str(next_rising_dt),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user