diff --git a/build-scripts/gulp/clean.js b/build-scripts/gulp/clean.js
index d1226c198e..fa26682819 100644
--- a/build-scripts/gulp/clean.js
+++ b/build-scripts/gulp/clean.js
@@ -1,6 +1,17 @@
const del = require("del");
const gulp = require("gulp");
const config = require("../paths");
+require("./translations");
-gulp.task("clean", () => del([config.root, config.build_dir]));
-gulp.task("clean-demo", () => del([config.demo_root, config.build_dir]));
+gulp.task(
+ "clean",
+ gulp.parallel("clean-translations", function cleanOutputAndBuildDir() {
+ return del([config.root, config.build_dir]);
+ })
+);
+gulp.task(
+ "clean-demo",
+ gulp.parallel("clean-translations", function cleanOutputAndBuildDir() {
+ return del([config.demo_root, config.build_dir]);
+ })
+);
diff --git a/build-scripts/gulp/gather-static.js b/build-scripts/gulp/gather-static.js
index 274581f322..2bdfda5f75 100644
--- a/build-scripts/gulp/gather-static.js
+++ b/build-scripts/gulp/gather-static.js
@@ -69,10 +69,6 @@ function copyMapPanel(staticDir) {
function compressStatic(staticDir) {
const staticPath = genStaticPath(staticDir);
- const fonts = gulp
- .src(staticPath("fonts/**/*.ttf"))
- .pipe(zopfli())
- .pipe(gulp.dest(staticPath("fonts")));
const polyfills = gulp
.src(staticPath("polyfills/*.js"))
.pipe(zopfli())
@@ -82,7 +78,7 @@ function compressStatic(staticDir) {
.pipe(zopfli())
.pipe(gulp.dest(staticPath("translations")));
- return merge(fonts, polyfills, translations);
+ return merge(polyfills, translations);
}
gulp.task("copy-static", (done) => {
diff --git a/build-scripts/gulp/translations.js b/build-scripts/gulp/translations.js
index a393f71479..cda82a6c01 100755
--- a/build-scripts/gulp/translations.js
+++ b/build-scripts/gulp/translations.js
@@ -124,18 +124,28 @@ gulp.task(taskName, function() {
});
tasks.push(taskName);
-taskName = "create-test-metadata";
-gulp.task(taskName, function(cb) {
- fs.writeFile(
- workDir + "/testMetadata.json",
- JSON.stringify({
- test: {
- nativeName: "Test",
- },
- }),
- cb
- );
+gulp.task("ensure-translations-build-dir", (done) => {
+ if (!fs.existsSync(workDir)) {
+ fs.mkdirSync(workDir);
+ }
+ done();
});
+
+taskName = "create-test-metadata";
+gulp.task(
+ taskName,
+ gulp.series("ensure-translations-build-dir", function writeTestMetaData(cb) {
+ fs.writeFile(
+ workDir + "/testMetadata.json",
+ JSON.stringify({
+ test: {
+ nativeName: "Test",
+ },
+ }),
+ cb
+ );
+ })
+);
tasks.push(taskName);
taskName = "create-test-translation";
diff --git a/setup.py b/setup.py
index 44c83bb9e0..d90b10390c 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="home-assistant-frontend",
- version="20190705.0",
+ version="20190710.0",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/home-assistant-polymer",
author="The Home Assistant Authors",
diff --git a/src/components/ha-menu-button.ts b/src/components/ha-menu-button.ts
index 1930eb608e..15a5887adb 100644
--- a/src/components/ha-menu-button.ts
+++ b/src/components/ha-menu-button.ts
@@ -21,6 +21,7 @@ class HaMenuButton extends LitElement {
@property() public narrow!: boolean;
@property() public hass!: HomeAssistant;
@property() private _hasNotifications = false;
+ private _alwaysVisible = false;
private _attachNotifOnConnect = false;
private _unsubNotifications?: UnsubscribeFunc;
@@ -62,6 +63,18 @@ class HaMenuButton extends LitElement {
`;
}
+ protected firstUpdated(changedProps) {
+ super.firstUpdated(changedProps);
+ if (!this.hassio) {
+ return;
+ }
+ // This component is used on Hass.io too, but Hass.io might run the UI
+ // on older frontends too, that don't have an always visible menu button
+ // in the sidebar.
+ this._alwaysVisible =
+ (Number((window.parent as any).frontendVersion) || 0) >= 20190710;
+ }
+
protected updated(changedProps) {
super.updated(changedProps);
@@ -69,7 +82,8 @@ class HaMenuButton extends LitElement {
return;
}
- this.style.visibility = this.narrow ? "initial" : "hidden";
+ this.style.visibility =
+ this.narrow || this._alwaysVisible ? "initial" : "hidden";
if (!this.narrow) {
this._hasNotifications = false;
diff --git a/src/entrypoints/app.ts b/src/entrypoints/app.ts
index c73fc24187..47147e49e0 100644
--- a/src/entrypoints/app.ts
+++ b/src/entrypoints/app.ts
@@ -16,3 +16,5 @@ import "../layouts/home-assistant";
setPassiveTouchGestures(true);
/* LastPass createElement workaround. See #428 */
document.createElement = Document.prototype.createElement;
+
+(window as any).frontendVersion = __VERSION__;
diff --git a/src/entrypoints/service-worker-hass.js b/src/entrypoints/service-worker-hass.js
index dc0afcf39a..8a0225d17b 100644
--- a/src/entrypoints/service-worker-hass.js
+++ b/src/entrypoints/service-worker-hass.js
@@ -19,9 +19,11 @@ function initRouting() {
new workbox.strategies.NetworkOnly()
);
- // Get manifest and service worker from network.
+ // Get manifest, service worker, onboarding from network.
workbox.routing.registerRoute(
- new RegExp(`${location.host}/(service_worker.js|manifest.json)`),
+ new RegExp(
+ `${location.host}/(service_worker.js|manifest.json|onboarding.html)`
+ ),
new workbox.strategies.NetworkOnly()
);
diff --git a/src/html/_js_base.html.template b/src/html/_js_base.html.template
index f9fac27261..e92b64036c 100644
--- a/src/html/_js_base.html.template
+++ b/src/html/_js_base.html.template
@@ -5,7 +5,7 @@
document.createElement("script"),
doc.lastChild
);
- script.type = "text/javascript";
+ script.defer = true;
script.src = src;
}
window.Polymer = {
@@ -15,11 +15,9 @@
suppressTemplateNotifications: true,
suppressBindingNotifications: true,
};
- var webComponentsSupported =
- "customElements" in window &&
- "content" in document.createElement("template");
- if (!webComponentsSupported) {
- _ls("/static/polyfills/webcomponents-bundle.js");
+ if (!("customElements" in window &&
+ "content" in document.createElement("template"))) {
+ document.write("
diff --git a/src/html/authorize.html.template b/src/html/authorize.html.template
index 6833ede06e..9b057978f9 100644
--- a/src/html/authorize.html.template
+++ b/src/html/authorize.html.template
@@ -5,13 +5,13 @@
diff --git a/src/html/onboarding.html.template b/src/html/onboarding.html.template
index c63949ae87..8f98f28290 100644
--- a/src/html/onboarding.html.template
+++ b/src/html/onboarding.html.template
@@ -5,13 +5,13 @@
diff --git a/src/panels/config/zwave/zwave-network.js b/src/panels/config/zwave/zwave-network.ts
similarity index 69%
rename from src/panels/config/zwave/zwave-network.js
rename to src/panels/config/zwave/zwave-network.ts
index 65c0b076ad..aeed3c23c0 100644
--- a/src/panels/config/zwave/zwave-network.js
+++ b/src/panels/config/zwave/zwave-network.ts
@@ -1,6 +1,17 @@
import "@polymer/paper-icon-button/paper-icon-button";
-import { html } from "@polymer/polymer/lib/utils/html-tag";
-import { PolymerElement } from "@polymer/polymer/polymer-element";
+
+import {
+ css,
+ CSSResult,
+ customElement,
+ html,
+ LitElement,
+ property,
+ TemplateResult,
+} from "lit-element";
+
+import { haStyle } from "../../../resources/styles";
+import { HomeAssistant } from "../../../types";
import "../../../components/buttons/ha-call-api-button";
import "../../../components/buttons/ha-call-service-button";
@@ -8,10 +19,184 @@ import "../../../components/ha-service-description";
import "../../../components/ha-card";
import "../ha-config-section";
-class ZwaveNetwork extends PolymerElement {
- static get template() {
+@customElement("zwave-network")
+export class ZwaveNetwork extends LitElement {
+ @property() public hass!: HomeAssistant;
+ @property() public isWide!: boolean;
+ @property() private _showHelp = false;
+
+ protected render(): TemplateResult | void {
return html`
-
-
-
- Z-Wave Network Management
-
-
-
- Run commands that affect the Z-Wave network. You won't get feedback on
- whether the command succeeded, but you can look in the OZW Log to try
- to figure out.
-
-
-
-