diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py
index dac2041fa56..5c97d855713 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,16 @@ 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):
+ 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/version.py b/homeassistant/components/frontend/version.py
index e291ca5bee6..83383baf11d 100644
--- a/homeassistant/components/frontend/version.py
+++ b/homeassistant/components/frontend/version.py
@@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
-VERSION = "d07b7ed1734ae3f2472f9ae88e0c3dea"
+VERSION = "aac488c33cd4291cd0924e60a55bd309"
diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html
index 376307744b8..907722b09ee 100644
--- a/homeassistant/components/frontend/www_static/frontend.html
+++ b/homeassistant/components/frontend/www_static/frontend.html
@@ -6080,12 +6080,12 @@ case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return
font-weight: 300;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
- }