diff --git a/.coveragerc b/.coveragerc index bf5582c2115..bd23599aa0d 100644 --- a/.coveragerc +++ b/.coveragerc @@ -55,6 +55,7 @@ omit = homeassistant/components/discovery.py homeassistant/components/downloader.py homeassistant/components/ifttt.py + homeassistant/components/influxdb.py homeassistant/components/keyboard.py homeassistant/components/light/hue.py homeassistant/components/light/mqtt.py diff --git a/homeassistant/components/demo.py b/homeassistant/components/demo.py index 8a8c5ed31e5..8b4b3fcce6c 100644 --- a/homeassistant/components/demo.py +++ b/homeassistant/components/demo.py @@ -53,9 +53,10 @@ def setup(hass, config): bootstrap.setup_component(hass, 'sun') # Setup demo platforms + demo_config = config.copy() for component in COMPONENTS_WITH_DEMO_PLATFORM: - bootstrap.setup_component( - hass, component, {component: {CONF_PLATFORM: 'demo'}}) + demo_config[component] = {CONF_PLATFORM: 'demo'} + bootstrap.setup_component(hass, component, demo_config) # Setup room groups lights = sorted(hass.states.entity_ids('light')) diff --git a/homeassistant/components/ecobee.py b/homeassistant/components/ecobee.py index a517e2d5418..f1ce746b48e 100644 --- a/homeassistant/components/ecobee.py +++ b/homeassistant/components/ecobee.py @@ -44,7 +44,7 @@ HOLD_TEMP = 'hold_temp' REQUIREMENTS = [ 'https://github.com/nkgilley/python-ecobee-api/archive/' - '5645f843b64ac4f6e59dfb96233a07083c5e10c1.zip#python-ecobee==0.0.3'] + '92a2f330cbaf601d0618456fdd97e5a8c42c1c47.zip#python-ecobee==0.0.4'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index dac2041fa56..fc955e30d44 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -22,8 +22,7 @@ _LOGGER = logging.getLogger(__name__) FRONTEND_URLS = [ URL_ROOT, '/logbook', '/history', '/map', '/devService', '/devState', - '/devEvent', '/devInfo'] -STATES_URL = re.compile(r'/states(/([a-zA-Z\._\-0-9/]+)|)') + '/devEvent', '/devInfo', '/states'] _FINGERPRINT = re.compile(r'^(\w+)-[a-z0-9]{32}\.(\w+)$', re.IGNORECASE) @@ -37,7 +36,8 @@ def setup(hass, config): for url in FRONTEND_URLS: hass.http.register_path('GET', url, _handle_get_root, False) - hass.http.register_path('GET', STATES_URL, _handle_get_root, False) + hass.http.register_path('GET', '/service_worker.js', + _handle_get_service_worker, False) # Static files hass.http.register_path( @@ -78,6 +78,17 @@ def _handle_get_root(handler, path_match, data): handler.wfile.write(template_html.encode("UTF-8")) +def _handle_get_service_worker(handler, path_match, data): + """ Returns service worker for the frontend. """ + if handler.server.development: + sw_path = "home-assistant-polymer/build/service_worker.js" + else: + sw_path = "service_worker.js" + + handler.write_file(os.path.join(os.path.dirname(__file__), 'www_static', + sw_path)) + + def _handle_get_static(handler, path_match, data): """ Returns a static file for the frontend. """ req_file = util.sanitize_path(path_match.group('file')) diff --git a/homeassistant/components/frontend/index.html.template b/homeassistant/components/frontend/index.html.template index 87c5f6638a7..c0631c9d9db 100644 --- a/homeassistant/components/frontend/index.html.template +++ b/homeassistant/components/frontend/index.html.template @@ -1,5 +1,5 @@ - +