mirror of
https://github.com/home-assistant/frontend.git
synced 2025-10-19 16:49:43 +00:00
Compare commits
1 Commits
20200623.1
...
app-alias
Author | SHA1 | Date | |
---|---|---|---|
![]() |
368973b668 |
@@ -66,11 +66,7 @@
|
|||||||
"import/prefer-default-export": 0,
|
"import/prefer-default-export": 0,
|
||||||
"import/no-unresolved": 0,
|
"import/no-unresolved": 0,
|
||||||
"import/no-cycle": 0,
|
"import/no-cycle": 0,
|
||||||
"import/extensions": [
|
"import/extensions": 0,
|
||||||
2,
|
|
||||||
"ignorePackages",
|
|
||||||
{ "ts": "never", "js": "never" }
|
|
||||||
],
|
|
||||||
"no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"],
|
"no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"],
|
||||||
"object-curly-newline": 0,
|
"object-curly-newline": 0,
|
||||||
"default-case": 0,
|
"default-case": 0,
|
||||||
|
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@@ -34,8 +34,10 @@ jobs:
|
|||||||
run: yarn install
|
run: yarn install
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
- name: Build resources
|
- name: Build icons
|
||||||
run: ./node_modules/.bin/gulp gen-icons-json build-translations gather-gallery-demos
|
run: ./node_modules/.bin/gulp gen-icons-json
|
||||||
|
- name: Build translations
|
||||||
|
run: ./node_modules/.bin/gulp build-translations
|
||||||
- name: Run eslint
|
- name: Run eslint
|
||||||
run: ./node_modules/.bin/eslint '{**/src,src}/**/*.{js,ts,html}' --ignore-path .gitignore
|
run: ./node_modules/.bin/eslint '{**/src,src}/**/*.{js,ts,html}' --ignore-path .gitignore
|
||||||
- name: Run tsc
|
- name: Run tsc
|
||||||
|
@@ -57,7 +57,7 @@ module.exports.babelOptions = ({ latestBuild }) => ({
|
|||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
plugins: [
|
plugins: [
|
||||||
// Part of ES2018. Converts {...a, b: 2} to Object.assign({}, a, {b: 2})
|
// Part of ES2018. Converts {...a, b: 2} to Object.assign({}, a, {b: 2})
|
||||||
!latestBuild && [
|
[
|
||||||
"@babel/plugin-proposal-object-rest-spread",
|
"@babel/plugin-proposal-object-rest-spread",
|
||||||
{ loose: true, useBuiltIns: true },
|
{ loose: true, useBuiltIns: true },
|
||||||
],
|
],
|
||||||
@@ -73,7 +73,7 @@ module.exports.babelOptions = ({ latestBuild }) => ({
|
|||||||
require("@babel/plugin-proposal-class-properties").default,
|
require("@babel/plugin-proposal-class-properties").default,
|
||||||
{ loose: true },
|
{ loose: true },
|
||||||
],
|
],
|
||||||
].filter(Boolean),
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Are already ES5, cause warnings when babelified.
|
// Are already ES5, cause warnings when babelified.
|
||||||
|
@@ -1,10 +1,7 @@
|
|||||||
// Run demo develop mode
|
// Run demo develop mode
|
||||||
const gulp = require("gulp");
|
const gulp = require("gulp");
|
||||||
const fs = require("fs");
|
|
||||||
const path = require("path");
|
|
||||||
|
|
||||||
const env = require("../env");
|
const env = require("../env");
|
||||||
const paths = require("../paths");
|
|
||||||
|
|
||||||
require("./clean.js");
|
require("./clean.js");
|
||||||
require("./translations.js");
|
require("./translations.js");
|
||||||
@@ -15,31 +12,6 @@ require("./service-worker.js");
|
|||||||
require("./entry-html.js");
|
require("./entry-html.js");
|
||||||
require("./rollup.js");
|
require("./rollup.js");
|
||||||
|
|
||||||
gulp.task("gather-gallery-demos", async function gatherDemos() {
|
|
||||||
const files = await fs.promises.readdir(
|
|
||||||
path.resolve(paths.gallery_dir, "src/demos")
|
|
||||||
);
|
|
||||||
|
|
||||||
let content = "export const DEMOS = {\n";
|
|
||||||
|
|
||||||
for (const file of files) {
|
|
||||||
const demoId = path.basename(file, ".ts");
|
|
||||||
const demoPath = "../src/demos/" + demoId;
|
|
||||||
content += ` "${demoId}": () => import("${demoPath}"),\n`;
|
|
||||||
}
|
|
||||||
|
|
||||||
content += "};";
|
|
||||||
|
|
||||||
const galleryBuild = path.resolve(paths.gallery_dir, "build");
|
|
||||||
|
|
||||||
fs.mkdirSync(galleryBuild, { recursive: true });
|
|
||||||
fs.writeFileSync(
|
|
||||||
path.resolve(galleryBuild, "import-demos.ts"),
|
|
||||||
content,
|
|
||||||
"utf-8"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task(
|
gulp.task(
|
||||||
"develop-gallery",
|
"develop-gallery",
|
||||||
gulp.series(
|
gulp.series(
|
||||||
@@ -48,11 +20,7 @@ gulp.task(
|
|||||||
},
|
},
|
||||||
"clean-gallery",
|
"clean-gallery",
|
||||||
"translations-enable-merge-backend",
|
"translations-enable-merge-backend",
|
||||||
gulp.parallel(
|
gulp.parallel("gen-icons-json", "build-translations"),
|
||||||
"gen-icons-json",
|
|
||||||
"build-translations",
|
|
||||||
"gather-gallery-demos"
|
|
||||||
),
|
|
||||||
"copy-static-gallery",
|
"copy-static-gallery",
|
||||||
"gen-index-gallery-dev",
|
"gen-index-gallery-dev",
|
||||||
env.useRollup() ? "rollup-dev-server-gallery" : "webpack-dev-server-gallery"
|
env.useRollup() ? "rollup-dev-server-gallery" : "webpack-dev-server-gallery"
|
||||||
@@ -67,11 +35,7 @@ gulp.task(
|
|||||||
},
|
},
|
||||||
"clean-gallery",
|
"clean-gallery",
|
||||||
"translations-enable-merge-backend",
|
"translations-enable-merge-backend",
|
||||||
gulp.parallel(
|
gulp.parallel("gen-icons-json", "build-translations"),
|
||||||
"gen-icons-json",
|
|
||||||
"build-translations",
|
|
||||||
"gather-gallery-demos"
|
|
||||||
),
|
|
||||||
"copy-static-gallery",
|
"copy-static-gallery",
|
||||||
env.useRollup() ? "rollup-prod-gallery" : "webpack-prod-gallery",
|
env.useRollup() ? "rollup-prod-gallery" : "webpack-prod-gallery",
|
||||||
"gen-index-gallery-prod"
|
"gen-index-gallery-prod"
|
||||||
|
@@ -37,21 +37,23 @@
|
|||||||
<body>
|
<body>
|
||||||
<%= renderTemplate('_js_base') %>
|
<%= renderTemplate('_js_base') %>
|
||||||
|
|
||||||
<script>
|
<script type="module" crossorigin="use-credentials">
|
||||||
import("<%= latestLauncherJS %>");
|
import "<%= latestLauncherJS %>";
|
||||||
window.latestJS = true;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script nomodule>
|
||||||
if (!window.latestJS) {
|
(function() {
|
||||||
<% if (useRollup) { %>
|
// // Safari 10.1 supports type=module but ignores nomodule, so we add this check.
|
||||||
_ls("/static/js/s.min.js").onload = function() {
|
if (!isS101) {
|
||||||
System.import("<%= es5LauncherJS %>");
|
<% if (useRollup) { %>
|
||||||
};
|
_ls("/static/js/s.min.js").onload = function() {
|
||||||
<% } else { %>
|
System.import("<%= es5LauncherJS %>");
|
||||||
_ls("<%= es5LauncherJS %>");
|
};
|
||||||
<% } %>
|
<% } else { %>
|
||||||
}
|
_ls("<%= es5LauncherJS %>");
|
||||||
|
<% } %>
|
||||||
|
}
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<hc-layout subtitle="FAQ">
|
<hc-layout subtitle="FAQ">
|
||||||
@@ -251,7 +253,7 @@ http:
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var _gaq = [["_setAccount", "UA-57927901-9"], ["_trackPageview"]];
|
var _gaq = [["_setAccount", "UA-57927901-9"], ["_trackPageview"]];
|
||||||
(function (d, t) {
|
(function(d, t) {
|
||||||
var g = d.createElement(t),
|
var g = d.createElement(t),
|
||||||
s = d.getElementsByTagName(t)[0];
|
s = d.getElementsByTagName(t)[0];
|
||||||
g.src =
|
g.src =
|
||||||
|
@@ -28,21 +28,23 @@
|
|||||||
|
|
||||||
<hc-connect></hc-connect>
|
<hc-connect></hc-connect>
|
||||||
|
|
||||||
<script>
|
<script type="module" crossorigin="use-credentials">
|
||||||
import("<%= latestLauncherJS %>");
|
import "<%= latestLauncherJS %>";
|
||||||
window.latestJS = true;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script nomodule>
|
||||||
if (!window.latestJS) {
|
(function() {
|
||||||
<% if (useRollup) { %>
|
// // Safari 10.1 supports type=module but ignores nomodule, so we add this check.
|
||||||
_ls("/static/js/s.min.js").onload = function() {
|
if (!isS101) {
|
||||||
System.import("<%= es5LauncherJS %>");
|
<% if (useRollup) { %>
|
||||||
};
|
_ls("/static/js/s.min.js").onload = function() {
|
||||||
<% } else { %>
|
System.import("<%= es5LauncherJS %>");
|
||||||
_ls("<%= es5LauncherJS %>");
|
};
|
||||||
<% } %>
|
<% } else { %>
|
||||||
}
|
_ls("<%= es5LauncherJS %>");
|
||||||
|
<% } %>
|
||||||
|
}
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
import "../../../src/resources/ha-style";
|
import "~app/resources/ha-style";
|
||||||
import "../../../src/resources/roboto";
|
import "~app/resources/roboto";
|
||||||
import "./layout/hc-connect";
|
import "./layout/hc-connect";
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable no-undef */
|
/* eslint-disable no-undef */
|
||||||
import { CAST_NS } from "../../../src/cast/const";
|
import { CAST_NS } from "~app/cast/const";
|
||||||
import { HassMessage } from "../../../src/cast/receiver_messages";
|
import { HassMessage } from "~app/cast/receiver_messages";
|
||||||
import "../../../src/resources/custom-card-support";
|
import "~app/resources/custom-card-support";
|
||||||
import { castContext } from "./cast_context";
|
import { castContext } from "./cast_context";
|
||||||
import { HcMain } from "./layout/hc-main";
|
import { HcMain } from "./layout/hc-main";
|
||||||
import { ReceivedMessage } from "./types";
|
import { ReceivedMessage } from "./types";
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -9,7 +10,6 @@ import {
|
|||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { until } from "lit-html/directives/until";
|
import { until } from "lit-html/directives/until";
|
||||||
import "../../../src/components/ha-card";
|
import "../../../src/components/ha-card";
|
||||||
import "../../../src/components/ha-circular-progress";
|
|
||||||
import { LovelaceCardConfig } from "../../../src/data/lovelace";
|
import { LovelaceCardConfig } from "../../../src/data/lovelace";
|
||||||
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||||
import { Lovelace, LovelaceCard } from "../../../src/panels/lovelace/types";
|
import { Lovelace, LovelaceCard } from "../../../src/panels/lovelace/types";
|
||||||
@@ -49,7 +49,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
|||||||
<div class="picker">
|
<div class="picker">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
${this._switching
|
${this._switching
|
||||||
? html`<ha-circular-progress active></ha-circular-progress>`
|
? html` <paper-spinner-lite active></paper-spinner-lite> `
|
||||||
: until(
|
: until(
|
||||||
selectedDemoConfig.then(
|
selectedDemoConfig.then(
|
||||||
(conf) => html`
|
(conf) => html`
|
||||||
|
@@ -86,26 +86,26 @@
|
|||||||
<%= renderTemplate('_js_base') %>
|
<%= renderTemplate('_js_base') %>
|
||||||
<%= renderTemplate('_preload_roboto') %>
|
<%= renderTemplate('_preload_roboto') %>
|
||||||
|
|
||||||
<script>
|
<script type="module" src="<%= latestDemoJS %>"></script>
|
||||||
import("<%= latestDemoJS %>");
|
|
||||||
window.latestJS = true;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
<script nomodule>
|
||||||
if (!window.latestJS) {
|
(function() {
|
||||||
<% if (useRollup) { %>
|
// // Safari 10.1 supports type=module but ignores nomodule, so we add this check.
|
||||||
_ls("/static/js/s.min.js").onload = function() {
|
if (!isS101) {
|
||||||
System.import("<%= es5DemoJS %>");
|
<% if (useRollup) { %>
|
||||||
};
|
_ls("/static/js/s.min.js").onload = function() {
|
||||||
<% } else { %>
|
System.import("<%= es5DemoJS %>");
|
||||||
_ls("<%= es5DemoJS %>");
|
};
|
||||||
<% } %>
|
<% } else { %>
|
||||||
}
|
_ls("<%= es5DemoJS %>");
|
||||||
|
<% } %>
|
||||||
|
}
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var _gaq = [["_setAccount", "UA-57927901-5"], ["_trackPageview"]];
|
var _gaq = [["_setAccount", "UA-57927901-5"], ["_trackPageview"]];
|
||||||
(function (d, t) {
|
(function(d, t) {
|
||||||
var g = d.createElement(t),
|
var g = d.createElement(t),
|
||||||
s = d.getElementsByTagName(t)[0];
|
s = d.getElementsByTagName(t)[0];
|
||||||
g.src =
|
g.src =
|
||||||
|
@@ -2,8 +2,8 @@ import "@polymer/app-layout/app-toolbar/app-toolbar";
|
|||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
import "../../../src/components/ha-switch";
|
import "~app/components/ha-switch";
|
||||||
import "../../../src/components/ha-formfield";
|
import "~app/components/ha-formfield";
|
||||||
import "./demo-card";
|
import "./demo-card";
|
||||||
|
|
||||||
class DemoCards extends PolymerElement {
|
class DemoCards extends PolymerElement {
|
||||||
|
@@ -11,7 +11,9 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
|
|||||||
import "../../src/components/ha-card";
|
import "../../src/components/ha-card";
|
||||||
import "../../src/managers/notification-manager";
|
import "../../src/managers/notification-manager";
|
||||||
import "../../src/styles/polymer-ha-style";
|
import "../../src/styles/polymer-ha-style";
|
||||||
import { DEMOS } from "../build/import-demos";
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
const DEMOS = require.context("./demos", true, /^(.*\.(ts$))[^.]*$/im);
|
||||||
|
|
||||||
const fixPath = (path) => path.substr(2, path.length - 5);
|
const fixPath = (path) => path.substr(2, path.length - 5);
|
||||||
|
|
||||||
@@ -161,7 +163,7 @@ class HaGallery extends PolymerElement {
|
|||||||
},
|
},
|
||||||
_demos: {
|
_demos: {
|
||||||
type: Array,
|
type: Array,
|
||||||
value: Object.keys(DEMOS),
|
value: DEMOS.keys().map(fixPath),
|
||||||
},
|
},
|
||||||
_lovelaceDemos: {
|
_lovelaceDemos: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@@ -208,7 +210,7 @@ class HaGallery extends PolymerElement {
|
|||||||
while (root.lastChild) root.removeChild(root.lastChild);
|
while (root.lastChild) root.removeChild(root.lastChild);
|
||||||
|
|
||||||
if (demo) {
|
if (demo) {
|
||||||
DEMOS[demo]();
|
DEMOS(`./${demo}.ts`);
|
||||||
const el = document.createElement(demo);
|
const el = document.createElement(demo);
|
||||||
root.appendChild(el);
|
root.appendChild(el);
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ import "../../../src/layouts/hass-tabs-subpage";
|
|||||||
import "../../../src/layouts/loading-screen";
|
import "../../../src/layouts/loading-screen";
|
||||||
import { HomeAssistant, Route } from "../../../src/types";
|
import { HomeAssistant, Route } from "../../../src/types";
|
||||||
import { showRepositoriesDialog } from "../dialogs/repositories/show-dialog-repositories";
|
import { showRepositoriesDialog } from "../dialogs/repositories/show-dialog-repositories";
|
||||||
import { supervisorTabs } from "../hassio-tabs";
|
import { supervisorTabs } from "../hassio-panel";
|
||||||
import "./hassio-addon-repository";
|
import "./hassio-addon-repository";
|
||||||
|
|
||||||
const sortRepos = (a: HassioAddonRepository, b: HassioAddonRepository) => {
|
const sortRepos = (a: HassioAddonRepository, b: HassioAddonRepository) => {
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -11,7 +12,6 @@ import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
|||||||
import { haStyle } from "../../../../src/resources/styles";
|
import { haStyle } from "../../../../src/resources/styles";
|
||||||
import { HomeAssistant } from "../../../../src/types";
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
import { hassioStyle } from "../../resources/hassio-style";
|
import { hassioStyle } from "../../resources/hassio-style";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
|
||||||
import "./hassio-addon-audio";
|
import "./hassio-addon-audio";
|
||||||
import "./hassio-addon-config";
|
import "./hassio-addon-config";
|
||||||
import "./hassio-addon-network";
|
import "./hassio-addon-network";
|
||||||
@@ -24,7 +24,7 @@ class HassioAddonConfigDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress active></ha-circular-progress>`;
|
return html` <paper-spinner-lite active></paper-spinner-lite> `;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -13,7 +14,6 @@ import {
|
|||||||
HassioAddonDetails,
|
HassioAddonDetails,
|
||||||
} from "../../../../src/data/hassio/addon";
|
} from "../../../../src/data/hassio/addon";
|
||||||
import "../../../../src/layouts/loading-screen";
|
import "../../../../src/layouts/loading-screen";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
|
||||||
import { haStyle } from "../../../../src/resources/styles";
|
import { haStyle } from "../../../../src/resources/styles";
|
||||||
import { HomeAssistant } from "../../../../src/types";
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
import { hassioStyle } from "../../resources/hassio-style";
|
import { hassioStyle } from "../../resources/hassio-style";
|
||||||
@@ -35,7 +35,7 @@ class HassioAddonDocumentationDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress active></ha-circular-progress>`;
|
return html` <paper-spinner-lite active></paper-spinner-lite> `;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@@ -4,6 +4,7 @@ import {
|
|||||||
mdiInformationVariant,
|
mdiInformationVariant,
|
||||||
mdiMathLog,
|
mdiMathLog,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -19,7 +20,6 @@ import {
|
|||||||
HassioAddonDetails,
|
HassioAddonDetails,
|
||||||
} from "../../../src/data/hassio/addon";
|
} from "../../../src/data/hassio/addon";
|
||||||
import "../../../src/layouts/hass-tabs-subpage";
|
import "../../../src/layouts/hass-tabs-subpage";
|
||||||
import "../../../src/components/ha-circular-progress";
|
|
||||||
import type { PageNavigation } from "../../../src/layouts/hass-tabs-subpage";
|
import type { PageNavigation } from "../../../src/layouts/hass-tabs-subpage";
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
import { HomeAssistant, Route } from "../../../src/types";
|
import { HomeAssistant, Route } from "../../../src/types";
|
||||||
@@ -56,7 +56,7 @@ class HassioAddonDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress active></ha-circular-progress>`;
|
return html` <paper-spinner-lite active></paper-spinner-lite> `;
|
||||||
}
|
}
|
||||||
|
|
||||||
const addonTabs: PageNavigation[] = [
|
const addonTabs: PageNavigation[] = [
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -8,7 +9,6 @@ import {
|
|||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
|
||||||
import { haStyle } from "../../../../src/resources/styles";
|
import { haStyle } from "../../../../src/resources/styles";
|
||||||
import { HomeAssistant } from "../../../../src/types";
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
import { hassioStyle } from "../../resources/hassio-style";
|
import { hassioStyle } from "../../resources/hassio-style";
|
||||||
@@ -24,7 +24,7 @@ class HassioAddonInfoDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress active></ha-circular-progress>`;
|
return html` <paper-spinner-lite active></paper-spinner-lite> `;
|
||||||
}
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -8,7 +9,6 @@ import {
|
|||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
|
||||||
import { haStyle } from "../../../../src/resources/styles";
|
import { haStyle } from "../../../../src/resources/styles";
|
||||||
import { HomeAssistant } from "../../../../src/types";
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
import { hassioStyle } from "../../resources/hassio-style";
|
import { hassioStyle } from "../../resources/hassio-style";
|
||||||
@@ -22,7 +22,7 @@ class HassioAddonLogDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html` <ha-circular-progress active></ha-circular-progress> `;
|
return html` <paper-spinner-lite active></paper-spinner-lite> `;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@@ -15,7 +15,7 @@ import {
|
|||||||
import "../../../src/layouts/hass-tabs-subpage";
|
import "../../../src/layouts/hass-tabs-subpage";
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
import { HomeAssistant, Route } from "../../../src/types";
|
import { HomeAssistant, Route } from "../../../src/types";
|
||||||
import { supervisorTabs } from "../hassio-tabs";
|
import { supervisorTabs } from "../hassio-panel";
|
||||||
import "./hassio-addons";
|
import "./hassio-addons";
|
||||||
import "./hassio-update";
|
import "./hassio-update";
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ import "@polymer/paper-input/paper-input";
|
|||||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
import "../../../../src/components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -108,7 +108,7 @@ class HassioRepositoriesDialog extends LitElement {
|
|||||||
></paper-input>
|
></paper-input>
|
||||||
<mwc-button @click=${this._addRepository}>
|
<mwc-button @click=${this._addRepository}>
|
||||||
${this._prosessing
|
${this._prosessing
|
||||||
? html`<ha-circular-progress active></ha-circular-progress>`
|
? html`<paper-spinner active></paper-spinner>`
|
||||||
: "Add"}
|
: "Add"}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import "../../src/resources/compatibility";
|
import "~app/resources/compatibility";
|
||||||
import "../../src/resources/roboto";
|
import "~app/resources/roboto";
|
||||||
import "./hassio-main";
|
import "./hassio-main";
|
||||||
|
|
||||||
const styleEl = document.createElement("style");
|
const styleEl = document.createElement("style");
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import { mdiBackupRestore, mdiCogs, mdiStore, mdiViewDashboard } from "@mdi/js";
|
||||||
import {
|
import {
|
||||||
customElement,
|
customElement,
|
||||||
html,
|
html,
|
||||||
@@ -11,9 +12,33 @@ import {
|
|||||||
HassioSupervisorInfo,
|
HassioSupervisorInfo,
|
||||||
HassioInfo,
|
HassioInfo,
|
||||||
} from "../../src/data/hassio/supervisor";
|
} from "../../src/data/hassio/supervisor";
|
||||||
|
import type { PageNavigation } from "../../src/layouts/hass-tabs-subpage";
|
||||||
import { HomeAssistant, Route } from "../../src/types";
|
import { HomeAssistant, Route } from "../../src/types";
|
||||||
import "./hassio-panel-router";
|
import "./hassio-panel-router";
|
||||||
|
|
||||||
|
export const supervisorTabs: PageNavigation[] = [
|
||||||
|
{
|
||||||
|
name: "Dashboard",
|
||||||
|
path: `/hassio/dashboard`,
|
||||||
|
iconPath: mdiViewDashboard,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Add-on store",
|
||||||
|
path: `/hassio/store`,
|
||||||
|
iconPath: mdiStore,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Snapshots",
|
||||||
|
path: `/hassio/snapshots`,
|
||||||
|
iconPath: mdiBackupRestore,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "System",
|
||||||
|
path: `/hassio/system`,
|
||||||
|
iconPath: mdiCogs,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
@customElement("hassio-panel")
|
@customElement("hassio-panel")
|
||||||
class HassioPanel extends LitElement {
|
class HassioPanel extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
import { mdiBackupRestore, mdiCogs, mdiStore, mdiViewDashboard } from "@mdi/js";
|
|
||||||
import type { PageNavigation } from "../../src/layouts/hass-tabs-subpage";
|
|
||||||
|
|
||||||
export const supervisorTabs: PageNavigation[] = [
|
|
||||||
{
|
|
||||||
name: "Dashboard",
|
|
||||||
path: `/hassio/dashboard`,
|
|
||||||
iconPath: mdiViewDashboard,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Add-on store",
|
|
||||||
path: `/hassio/store`,
|
|
||||||
iconPath: mdiStore,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Snapshots",
|
|
||||||
path: `/hassio/snapshots`,
|
|
||||||
iconPath: mdiBackupRestore,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "System",
|
|
||||||
path: `/hassio/system`,
|
|
||||||
iconPath: mdiCogs,
|
|
||||||
},
|
|
||||||
];
|
|
@@ -37,7 +37,7 @@ import { haStyle } from "../../../src/resources/styles";
|
|||||||
import { HomeAssistant, Route } from "../../../src/types";
|
import { HomeAssistant, Route } from "../../../src/types";
|
||||||
import "../components/hassio-card-content";
|
import "../components/hassio-card-content";
|
||||||
import { showHassioSnapshotDialog } from "../dialogs/snapshot/show-dialog-hassio-snapshot";
|
import { showHassioSnapshotDialog } from "../dialogs/snapshot/show-dialog-hassio-snapshot";
|
||||||
import { supervisorTabs } from "../hassio-tabs";
|
import { supervisorTabs } from "../hassio-panel";
|
||||||
import { hassioStyle } from "../resources/hassio-style";
|
import { hassioStyle } from "../resources/hassio-style";
|
||||||
|
|
||||||
interface CheckboxItem {
|
interface CheckboxItem {
|
||||||
|
@@ -18,7 +18,7 @@ import {
|
|||||||
import "../../../src/layouts/hass-tabs-subpage";
|
import "../../../src/layouts/hass-tabs-subpage";
|
||||||
import { haStyle } from "../../../src/resources/styles";
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
import { HomeAssistant, Route } from "../../../src/types";
|
import { HomeAssistant, Route } from "../../../src/types";
|
||||||
import { supervisorTabs } from "../hassio-tabs";
|
import { supervisorTabs } from "../hassio-panel";
|
||||||
import { hassioStyle } from "../resources/hassio-style";
|
import { hassioStyle } from "../resources/hassio-style";
|
||||||
import "./hassio-host-info";
|
import "./hassio-host-info";
|
||||||
import "./hassio-supervisor-info";
|
import "./hassio-supervisor-info";
|
||||||
|
@@ -22,11 +22,11 @@
|
|||||||
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
|
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"~app": "file:./src",
|
||||||
"@formatjs/intl-pluralrules": "^1.5.8",
|
"@formatjs/intl-pluralrules": "^1.5.8",
|
||||||
"@fullcalendar/core": "^5.0.0-beta.2",
|
"@fullcalendar/core": "^5.0.0-beta.2",
|
||||||
"@fullcalendar/daygrid": "^5.0.0-beta.2",
|
"@fullcalendar/daygrid": "^5.0.0-beta.2",
|
||||||
"@material/chips": "7.0.0-canary.d92d8c93e.0",
|
"@material/chips": "7.0.0-canary.d92d8c93e.0",
|
||||||
"@material/circular-progress": "7.0.0-canary.d92d8c93e.0",
|
|
||||||
"@material/mwc-button": "^0.15.0",
|
"@material/mwc-button": "^0.15.0",
|
||||||
"@material/mwc-checkbox": "^0.15.0",
|
"@material/mwc-checkbox": "^0.15.0",
|
||||||
"@material/mwc-dialog": "^0.15.0",
|
"@material/mwc-dialog": "^0.15.0",
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
"@polymer/iron-image": "^3.0.1",
|
"@polymer/iron-image": "^3.0.1",
|
||||||
"@polymer/iron-input": "^3.0.1",
|
"@polymer/iron-input": "^3.0.1",
|
||||||
"@polymer/iron-label": "^3.0.1",
|
"@polymer/iron-label": "^3.0.1",
|
||||||
|
"@polymer/iron-media-query": "^3.0.1",
|
||||||
"@polymer/iron-overlay-behavior": "^3.0.2",
|
"@polymer/iron-overlay-behavior": "^3.0.2",
|
||||||
"@polymer/iron-resizable-behavior": "^3.0.1",
|
"@polymer/iron-resizable-behavior": "^3.0.1",
|
||||||
"@polymer/paper-card": "^3.0.1",
|
"@polymer/paper-card": "^3.0.1",
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
"@polymer/paper-radio-group": "^3.0.1",
|
"@polymer/paper-radio-group": "^3.0.1",
|
||||||
"@polymer/paper-ripple": "^3.0.1",
|
"@polymer/paper-ripple": "^3.0.1",
|
||||||
"@polymer/paper-slider": "^3.0.1",
|
"@polymer/paper-slider": "^3.0.1",
|
||||||
|
"@polymer/paper-spinner": "^3.0.2",
|
||||||
"@polymer/paper-styles": "^3.0.1",
|
"@polymer/paper-styles": "^3.0.1",
|
||||||
"@polymer/paper-tabs": "^3.0.1",
|
"@polymer/paper-tabs": "^3.0.1",
|
||||||
"@polymer/paper-toast": "^3.0.1",
|
"@polymer/paper-toast": "^3.0.1",
|
||||||
|
2
setup.py
2
setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="home-assistant-frontend",
|
name="home-assistant-frontend",
|
||||||
version="20200623.1",
|
version="20200620.0",
|
||||||
description="The Home Assistant frontend",
|
description="The Home Assistant frontend",
|
||||||
url="https://github.com/home-assistant/home-assistant-polymer",
|
url="https://github.com/home-assistant/home-assistant-polymer",
|
||||||
author="The Home Assistant Authors",
|
author="The Home Assistant Authors",
|
||||||
|
@@ -37,7 +37,6 @@ export const DOMAINS_WITH_MORE_INFO = [
|
|||||||
"fan",
|
"fan",
|
||||||
"group",
|
"group",
|
||||||
"history_graph",
|
"history_graph",
|
||||||
"humidifier",
|
|
||||||
"input_datetime",
|
"input_datetime",
|
||||||
"light",
|
"light",
|
||||||
"lock",
|
"lock",
|
||||||
@@ -80,7 +79,6 @@ export const DOMAINS_TOGGLE = new Set([
|
|||||||
"switch",
|
"switch",
|
||||||
"group",
|
"group",
|
||||||
"automation",
|
"automation",
|
||||||
"humidifier",
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Temperature units. */
|
/** Temperature units. */
|
||||||
|
@@ -55,12 +55,6 @@ export const computeStateDisplay = (
|
|||||||
return formatDateTime(date, language);
|
return formatDateTime(date, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (domain === "humidifier") {
|
|
||||||
if (stateObj.state === "on" && stateObj.attributes.humidity) {
|
|
||||||
return `${stateObj.attributes.humidity}%`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// Return device class translation
|
// Return device class translation
|
||||||
(stateObj.attributes.device_class &&
|
(stateObj.attributes.device_class &&
|
||||||
|
@@ -22,7 +22,6 @@ const fixedIcons = {
|
|||||||
history_graph: "hass:chart-line",
|
history_graph: "hass:chart-line",
|
||||||
homeassistant: "hass:home-assistant",
|
homeassistant: "hass:home-assistant",
|
||||||
homekit: "hass:home-automation",
|
homekit: "hass:home-automation",
|
||||||
humidifier: "hass:air-humidifier",
|
|
||||||
image_processing: "hass:image-filter-frames",
|
image_processing: "hass:image-filter-frames",
|
||||||
input_boolean: "hass:toggle-switch-outline",
|
input_boolean: "hass:toggle-switch-outline",
|
||||||
input_datetime: "hass:calendar-clock",
|
input_datetime: "hass:calendar-clock",
|
||||||
|
@@ -8,7 +8,6 @@ export const iconColorCSS = css`
|
|||||||
ha-icon[data-domain="camera"][data-state="streaming"],
|
ha-icon[data-domain="camera"][data-state="streaming"],
|
||||||
ha-icon[data-domain="cover"][data-state="open"],
|
ha-icon[data-domain="cover"][data-state="open"],
|
||||||
ha-icon[data-domain="fan"][data-state="on"],
|
ha-icon[data-domain="fan"][data-state="on"],
|
||||||
ha-icon[data-domain="humidifier"][data-state="on"],
|
|
||||||
ha-icon[data-domain="light"][data-state="on"],
|
ha-icon[data-domain="light"][data-state="on"],
|
||||||
ha-icon[data-domain="input_boolean"][data-state="on"],
|
ha-icon[data-domain="input_boolean"][data-state="on"],
|
||||||
ha-icon[data-domain="lock"][data-state="unlocked"],
|
ha-icon[data-domain="lock"][data-state="unlocked"],
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "../ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
@@ -51,9 +51,7 @@ class HaProgressButton extends PolymerElement {
|
|||||||
<slot></slot>
|
<slot></slot>
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<template is="dom-if" if="[[progress]]">
|
<template is="dom-if" if="[[progress]]">
|
||||||
<div class="progress">
|
<div class="progress"><paper-spinner active=""></paper-spinner></div>
|
||||||
<ha-circular-progress active size="small"></ha-circular-progress>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@@ -22,7 +22,7 @@ const isOn = (stateObj?: HassEntity) =>
|
|||||||
!STATES_OFF.includes(stateObj.state) &&
|
!STATES_OFF.includes(stateObj.state) &&
|
||||||
!UNAVAILABLE_STATES.includes(stateObj.state);
|
!UNAVAILABLE_STATES.includes(stateObj.state);
|
||||||
|
|
||||||
export class HaEntityToggle extends LitElement {
|
class HaEntityToggle extends LitElement {
|
||||||
// hass is not a property so that we only re-render on stateObj changes
|
// hass is not a property so that we only re-render on stateObj changes
|
||||||
public hass?: HomeAssistant;
|
public hass?: HomeAssistant;
|
||||||
|
|
||||||
|
@@ -1,93 +0,0 @@
|
|||||||
import {
|
|
||||||
LitElement,
|
|
||||||
TemplateResult,
|
|
||||||
property,
|
|
||||||
svg,
|
|
||||||
html,
|
|
||||||
customElement,
|
|
||||||
unsafeCSS,
|
|
||||||
SVGTemplateResult,
|
|
||||||
css,
|
|
||||||
} from "lit-element";
|
|
||||||
// @ts-ignore
|
|
||||||
import progressStyles from "@material/circular-progress/dist/mdc.circular-progress.min.css";
|
|
||||||
import { classMap } from "lit-html/directives/class-map";
|
|
||||||
|
|
||||||
@customElement("ha-circular-progress")
|
|
||||||
export class HaCircularProgress extends LitElement {
|
|
||||||
@property({ type: Boolean })
|
|
||||||
public active = false;
|
|
||||||
|
|
||||||
@property()
|
|
||||||
public alt = "Loading";
|
|
||||||
|
|
||||||
@property()
|
|
||||||
public size: "small" | "medium" | "large" = "medium";
|
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
|
||||||
let indeterminatePart: SVGTemplateResult;
|
|
||||||
|
|
||||||
if (this.size === "small") {
|
|
||||||
indeterminatePart = svg`
|
|
||||||
<svg class="mdc-circular-progress__indeterminate-circle-graphic" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<circle cx="12" cy="12" r="8.75" stroke-dasharray="54.978" stroke-dashoffset="27.489"/>
|
|
||||||
</svg>`;
|
|
||||||
} else if (this.size === "large") {
|
|
||||||
indeterminatePart = svg`
|
|
||||||
<svg class="mdc-circular-progress__indeterminate-circle-graphic" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<circle cx="24" cy="24" r="18" stroke-dasharray="113.097" stroke-dashoffset="56.549"/>
|
|
||||||
</svg>`;
|
|
||||||
} else {
|
|
||||||
// medium
|
|
||||||
indeterminatePart = svg`
|
|
||||||
<svg class="mdc-circular-progress__indeterminate-circle-graphic" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<circle cx="16" cy="16" r="12.5" stroke-dasharray="78.54" stroke-dashoffset="39.27"/>
|
|
||||||
</svg>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignoring prettier as it will introduce unwanted whitespace
|
|
||||||
// We have not implemented the determinate support of mdc circular progress.
|
|
||||||
// prettier-ignore
|
|
||||||
return html`
|
|
||||||
<div
|
|
||||||
class="mdc-circular-progress ${classMap({
|
|
||||||
"mdc-circular-progress--indeterminate": this.active,
|
|
||||||
[`mdc-circular-progress--${this.size}`]: true,
|
|
||||||
})}"
|
|
||||||
role="progressbar"
|
|
||||||
aria-label=${this.alt}
|
|
||||||
aria-valuemin="0"
|
|
||||||
aria-valuemax="1"
|
|
||||||
>
|
|
||||||
<div class="mdc-circular-progress__indeterminate-container">
|
|
||||||
<div class="mdc-circular-progress__spinner-layer">
|
|
||||||
<div class="mdc-circular-progress__circle-clipper mdc-circular-progress__circle-left">
|
|
||||||
${indeterminatePart}
|
|
||||||
</div><div class="mdc-circular-progress__gap-patch">
|
|
||||||
${indeterminatePart}
|
|
||||||
</div><div class="mdc-circular-progress__circle-clipper mdc-circular-progress__circle-right">
|
|
||||||
${indeterminatePart}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
static get styles() {
|
|
||||||
return [
|
|
||||||
unsafeCSS(progressStyles),
|
|
||||||
css`
|
|
||||||
:host {
|
|
||||||
text-align: initial;
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface HTMLElementTagNameMap {
|
|
||||||
"ha-circular-progress": HaCircularProgress;
|
|
||||||
}
|
|
||||||
}
|
|
24
src/components/ha-demo-badge.js
Normal file
24
src/components/ha-demo-badge.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
|
/* eslint-plugin-disable lit */
|
||||||
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
|
import "./ha-label-badge";
|
||||||
|
|
||||||
|
class HaDemoBadge extends PolymerElement {
|
||||||
|
static get template() {
|
||||||
|
return html`
|
||||||
|
<style>
|
||||||
|
:host {
|
||||||
|
--ha-label-badge-color: #dac90d;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<ha-label-badge
|
||||||
|
icon="hass:emoticon"
|
||||||
|
label="Demo"
|
||||||
|
description=""
|
||||||
|
></ha-label-badge>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
customElements.define("ha-demo-badge", HaDemoBadge);
|
@@ -6,6 +6,7 @@ import {
|
|||||||
mdiMenu,
|
mdiMenu,
|
||||||
mdiViewDashboard,
|
mdiViewDashboard,
|
||||||
} from "@mdi/js";
|
} from "@mdi/js";
|
||||||
|
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
||||||
import "@polymer/paper-item/paper-icon-item";
|
import "@polymer/paper-item/paper-icon-item";
|
||||||
import type { PaperIconItemElement } from "@polymer/paper-item/paper-icon-item";
|
import type { PaperIconItemElement } from "@polymer/paper-item/paper-icon-item";
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
@@ -15,7 +16,6 @@ import {
|
|||||||
CSSResult,
|
CSSResult,
|
||||||
eventOptions,
|
eventOptions,
|
||||||
html,
|
html,
|
||||||
customElement,
|
|
||||||
LitElement,
|
LitElement,
|
||||||
property,
|
property,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
@@ -109,7 +109,9 @@ const computePanels = (hass: HomeAssistant): [PanelInfo[], PanelInfo[]] => {
|
|||||||
return [beforeSpacer, afterSpacer];
|
return [beforeSpacer, afterSpacer];
|
||||||
};
|
};
|
||||||
|
|
||||||
@customElement("ha-sidebar")
|
/*
|
||||||
|
* @appliesMixin LocalizeMixin
|
||||||
|
*/
|
||||||
class HaSidebar extends LitElement {
|
class HaSidebar extends LitElement {
|
||||||
@property() public hass!: HomeAssistant;
|
@property() public hass!: HomeAssistant;
|
||||||
|
|
||||||
@@ -747,3 +749,5 @@ declare global {
|
|||||||
"ha-sidebar": HaSidebar;
|
"ha-sidebar": HaSidebar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
customElements.define("ha-sidebar", HaSidebar);
|
||||||
|
@@ -262,28 +262,6 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
|||||||
pushData(new Date(state.last_changed), series);
|
pushData(new Date(state.last_changed), series);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (domain === "humidifier") {
|
|
||||||
addColumn(
|
|
||||||
`${this.hass.localize(
|
|
||||||
"ui.card.humidifier.target_humidity_entity",
|
|
||||||
"name",
|
|
||||||
name
|
|
||||||
)}`,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
addColumn(
|
|
||||||
`${this.hass.localize("ui.card.humidifier.on_entity", "name", name)}`,
|
|
||||||
true,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
states.states.forEach((state) => {
|
|
||||||
if (!state.attributes) return;
|
|
||||||
const target = safeParseFloat(state.attributes.humidity);
|
|
||||||
const series = [target];
|
|
||||||
series.push(state.state === "on" ? target : null);
|
|
||||||
pushData(new Date(state.last_changed), series);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// Only disable interpolation for sensors
|
// Only disable interpolation for sensors
|
||||||
const isStep = domain === "sensor";
|
const isStep = domain === "sensor";
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import "./ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
|
@@ -5,15 +5,13 @@ import { computeStateName } from "../common/entity/compute_state_name";
|
|||||||
import { LocalizeFunc } from "../common/translations/localize";
|
import { LocalizeFunc } from "../common/translations/localize";
|
||||||
import { HomeAssistant } from "../types";
|
import { HomeAssistant } from "../types";
|
||||||
|
|
||||||
const DOMAINS_USE_LAST_UPDATED = ["climate", "humidifier", "water_heater"];
|
const DOMAINS_USE_LAST_UPDATED = ["climate", "water_heater"];
|
||||||
const LINE_ATTRIBUTES_TO_KEEP = [
|
const LINE_ATTRIBUTES_TO_KEEP = [
|
||||||
"temperature",
|
"temperature",
|
||||||
"current_temperature",
|
"current_temperature",
|
||||||
"target_temp_low",
|
"target_temp_low",
|
||||||
"target_temp_high",
|
"target_temp_high",
|
||||||
"hvac_action",
|
"hvac_action",
|
||||||
"humidity",
|
|
||||||
"mode",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export interface LineChartState {
|
export interface LineChartState {
|
||||||
@@ -226,8 +224,6 @@ export const computeHistory = (
|
|||||||
unit = hass.config.unit_system.temperature;
|
unit = hass.config.unit_system.temperature;
|
||||||
} else if (computeStateDomain(stateInfo[0]) === "water_heater") {
|
} else if (computeStateDomain(stateInfo[0]) === "water_heater") {
|
||||||
unit = hass.config.unit_system.temperature;
|
unit = hass.config.unit_system.temperature;
|
||||||
} else if (computeStateDomain(stateInfo[0]) === "humidifier") {
|
|
||||||
unit = "%";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!unit) {
|
if (!unit) {
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
import {
|
|
||||||
HassEntityAttributeBase,
|
|
||||||
HassEntityBase,
|
|
||||||
} from "home-assistant-js-websocket";
|
|
||||||
|
|
||||||
export type HumidifierEntity = HassEntityBase & {
|
|
||||||
attributes: HassEntityAttributeBase & {
|
|
||||||
humidity?: number;
|
|
||||||
min_humidity?: number;
|
|
||||||
max_humidity?: number;
|
|
||||||
mode?: string;
|
|
||||||
available_modes?: string[];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const HUMIDIFIER_SUPPORT_MODES = 1;
|
|
||||||
|
|
||||||
export const HUMIDIFIER_DEVICE_CLASS_HUMIDIFIER = "humidifier";
|
|
||||||
export const HUMIDIFIER_DEVICE_CLASS_DEHUMIDIFIER = "dehumidifier";
|
|
@@ -10,7 +10,6 @@ import {
|
|||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "../../components/dialog/ha-paper-dialog";
|
import "../../components/dialog/ha-paper-dialog";
|
||||||
import "../../components/ha-circular-progress";
|
|
||||||
import "../../components/ha-switch";
|
import "../../components/ha-switch";
|
||||||
import "../../components/ha-formfield";
|
import "../../components/ha-formfield";
|
||||||
import type { HaSwitch } from "../../components/ha-switch";
|
import type { HaSwitch } from "../../components/ha-switch";
|
||||||
@@ -76,7 +75,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
|||||||
${this._loading
|
${this._loading
|
||||||
? html`
|
? html`
|
||||||
<div class="init-spinner">
|
<div class="init-spinner">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner-lite active></paper-spinner-lite>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
import "../../components/ha-icon-button";
|
import "../../components/ha-icon-button";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import "@polymer/paper-tooltip/paper-tooltip";
|
import "@polymer/paper-tooltip/paper-tooltip";
|
||||||
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
|
import type { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
import {
|
import {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import "@polymer/paper-tooltip/paper-tooltip";
|
import "@polymer/paper-tooltip/paper-tooltip";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
@@ -76,7 +76,7 @@ class StepFlowForm extends LitElement {
|
|||||||
${this._loading
|
${this._loading
|
||||||
? html`
|
? html`
|
||||||
<div class="submit-spinner">
|
<div class="submit-spinner">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -7,7 +8,6 @@ import {
|
|||||||
property,
|
property,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "../../components/ha-circular-progress";
|
|
||||||
|
|
||||||
@customElement("step-flow-loading")
|
@customElement("step-flow-loading")
|
||||||
class StepFlowLoading extends LitElement {
|
class StepFlowLoading extends LitElement {
|
||||||
@@ -17,7 +17,7 @@ class StepFlowLoading extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<div class="init-spinner">
|
<div class="init-spinner">
|
||||||
${this.label ? html` <div>${this.label}</div> ` : ""}
|
${this.label ? html` <div>${this.label}</div> ` : ""}
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner-lite active></paper-spinner-lite>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ class StepFlowLoading extends LitElement {
|
|||||||
padding: 50px 100px;
|
padding: 50px 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner-lite {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import "@polymer/paper-item/paper-icon-item";
|
import "@polymer/paper-item/paper-icon-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
|
@@ -2,7 +2,7 @@ import "@material/mwc-button";
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
||||||
import "@polymer/iron-input/iron-input";
|
import "@polymer/iron-input/iron-input";
|
||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
import "../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
@@ -38,7 +38,7 @@ class MoreInfoConfigurator extends PolymerElement {
|
|||||||
height: 41px;
|
height: 41px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
@@ -75,11 +75,11 @@ class MoreInfoConfigurator extends PolymerElement {
|
|||||||
disabled="[[isConfiguring]]"
|
disabled="[[isConfiguring]]"
|
||||||
on-click="submitClicked"
|
on-click="submitClicked"
|
||||||
>
|
>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
active="[[isConfiguring]]"
|
active="[[isConfiguring]]"
|
||||||
hidden="[[!isConfiguring]]"
|
hidden="[[!isConfiguring]]"
|
||||||
alt="Configuring"
|
alt="Configuring"
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
[[stateObj.attributes.submit_caption]]
|
[[stateObj.attributes.submit_caption]]
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</p>
|
</p>
|
||||||
|
@@ -14,7 +14,6 @@ import "./more-info-default";
|
|||||||
import "./more-info-fan";
|
import "./more-info-fan";
|
||||||
import "./more-info-group";
|
import "./more-info-group";
|
||||||
import "./more-info-history_graph";
|
import "./more-info-history_graph";
|
||||||
import "./more-info-humidifier";
|
|
||||||
import "./more-info-input_datetime";
|
import "./more-info-input_datetime";
|
||||||
import "./more-info-light";
|
import "./more-info-light";
|
||||||
import "./more-info-lock";
|
import "./more-info-lock";
|
||||||
|
@@ -1,218 +0,0 @@
|
|||||||
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
|
|
||||||
import "@polymer/paper-item/paper-item";
|
|
||||||
import "@polymer/paper-listbox/paper-listbox";
|
|
||||||
import {
|
|
||||||
css,
|
|
||||||
CSSResult,
|
|
||||||
html,
|
|
||||||
LitElement,
|
|
||||||
property,
|
|
||||||
PropertyValues,
|
|
||||||
TemplateResult,
|
|
||||||
} from "lit-element";
|
|
||||||
import { classMap } from "lit-html/directives/class-map";
|
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
|
||||||
import { supportsFeature } from "../../../common/entity/supports-feature";
|
|
||||||
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
|
||||||
import "../../../components/ha-paper-dropdown-menu";
|
|
||||||
import "../../../components/ha-paper-slider";
|
|
||||||
import "../../../components/ha-switch";
|
|
||||||
import {
|
|
||||||
HumidifierEntity,
|
|
||||||
HUMIDIFIER_SUPPORT_MODES,
|
|
||||||
} from "../../../data/humidifier";
|
|
||||||
import { HomeAssistant } from "../../../types";
|
|
||||||
|
|
||||||
class MoreInfoHumidifier extends LitElement {
|
|
||||||
@property() public hass!: HomeAssistant;
|
|
||||||
|
|
||||||
@property() public stateObj?: HumidifierEntity;
|
|
||||||
|
|
||||||
private _resizeDebounce?: number;
|
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
|
||||||
if (!this.stateObj) {
|
|
||||||
return html``;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hass = this.hass;
|
|
||||||
const stateObj = this.stateObj;
|
|
||||||
|
|
||||||
const supportModes = supportsFeature(stateObj, HUMIDIFIER_SUPPORT_MODES);
|
|
||||||
|
|
||||||
const rtlDirection = computeRTLDirection(hass);
|
|
||||||
|
|
||||||
return html`
|
|
||||||
<div
|
|
||||||
class=${classMap({
|
|
||||||
"has-modes": supportModes,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<div class="container-humidity">
|
|
||||||
<div>${hass.localize("ui.card.humidifier.humidity")}</div>
|
|
||||||
<div class="single-row">
|
|
||||||
<div class="target-humidity">
|
|
||||||
${stateObj.attributes.humidity} %
|
|
||||||
</div>
|
|
||||||
<ha-paper-slider
|
|
||||||
class="humidity"
|
|
||||||
step="1"
|
|
||||||
pin
|
|
||||||
ignore-bar-touch
|
|
||||||
dir=${rtlDirection}
|
|
||||||
.min=${stateObj.attributes.min_humidity}
|
|
||||||
.max=${stateObj.attributes.max_humidity}
|
|
||||||
.secondaryProgress=${stateObj.attributes.max_humidity}
|
|
||||||
.value=${stateObj.attributes.humidity}
|
|
||||||
@change=${this._targetHumiditySliderChanged}
|
|
||||||
>
|
|
||||||
</ha-paper-slider>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${supportModes
|
|
||||||
? html`
|
|
||||||
<div class="container-modes">
|
|
||||||
<ha-paper-dropdown-menu
|
|
||||||
label-float
|
|
||||||
dynamic-align
|
|
||||||
.label=${hass.localize("ui.card.humidifier.mode")}
|
|
||||||
>
|
|
||||||
<paper-listbox
|
|
||||||
slot="dropdown-content"
|
|
||||||
attr-for-selected="item-name"
|
|
||||||
.selected=${stateObj.attributes.mode}
|
|
||||||
@selected-changed=${this._handleModeChanged}
|
|
||||||
>
|
|
||||||
${stateObj.attributes.available_modes!.map(
|
|
||||||
(mode) => html`
|
|
||||||
<paper-item item-name=${mode}>
|
|
||||||
${hass.localize(
|
|
||||||
`state_attributes.humidifier.mode.${mode}`
|
|
||||||
) || mode}
|
|
||||||
</paper-item>
|
|
||||||
`
|
|
||||||
)}
|
|
||||||
</paper-listbox>
|
|
||||||
</ha-paper-dropdown-menu>
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
: ""}
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected updated(changedProps: PropertyValues) {
|
|
||||||
super.updated(changedProps);
|
|
||||||
if (!changedProps.has("stateObj") || !this.stateObj) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this._resizeDebounce) {
|
|
||||||
clearTimeout(this._resizeDebounce);
|
|
||||||
}
|
|
||||||
this._resizeDebounce = window.setTimeout(() => {
|
|
||||||
fireEvent(this, "iron-resize");
|
|
||||||
this._resizeDebounce = undefined;
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _targetHumiditySliderChanged(ev) {
|
|
||||||
const newVal = ev.target.value;
|
|
||||||
this._callServiceHelper(
|
|
||||||
this.stateObj!.attributes.humidity,
|
|
||||||
newVal,
|
|
||||||
"set_humidity",
|
|
||||||
{ humidity: newVal }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _handleModeChanged(ev) {
|
|
||||||
const newVal = ev.detail.value || null;
|
|
||||||
this._callServiceHelper(
|
|
||||||
this.stateObj!.attributes.mode,
|
|
||||||
newVal,
|
|
||||||
"set_mode",
|
|
||||||
{ mode: newVal }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async _callServiceHelper(
|
|
||||||
oldVal: unknown,
|
|
||||||
newVal: unknown,
|
|
||||||
service: string,
|
|
||||||
data: {
|
|
||||||
entity_id?: string;
|
|
||||||
[key: string]: unknown;
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
if (oldVal === newVal) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
data.entity_id = this.stateObj!.entity_id;
|
|
||||||
const curState = this.stateObj;
|
|
||||||
|
|
||||||
await this.hass.callService("humidifier", service, data);
|
|
||||||
|
|
||||||
// We reset stateObj to re-sync the inputs with the state. It will be out
|
|
||||||
// of sync if our service call did not result in the entity to be turned
|
|
||||||
// on. Since the state is not changing, the resync is not called automatic.
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
||||||
|
|
||||||
// No need to resync if we received a new state.
|
|
||||||
if (this.stateObj !== curState) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.stateObj = undefined;
|
|
||||||
await this.updateComplete;
|
|
||||||
// Only restore if not set yet by a state change
|
|
||||||
if (this.stateObj === undefined) {
|
|
||||||
this.stateObj = curState;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static get styles(): CSSResult {
|
|
||||||
return css`
|
|
||||||
:host {
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
ha-paper-dropdown-menu {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-item {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
ha-paper-slider {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container-humidity .single-row {
|
|
||||||
display: flex;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.target-humidity {
|
|
||||||
width: 90px;
|
|
||||||
font-size: 200%;
|
|
||||||
margin: auto;
|
|
||||||
direction: ltr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.humidity {
|
|
||||||
--paper-slider-active-color: var(--paper-blue-400);
|
|
||||||
--paper-slider-secondary-color: var(--paper-blue-400);
|
|
||||||
}
|
|
||||||
|
|
||||||
.single-row {
|
|
||||||
padding: 8px 0;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("more-info-humidifier", MoreInfoHumidifier);
|
|
@@ -52,7 +52,7 @@
|
|||||||
<%= renderTemplate('_js_base') %>
|
<%= renderTemplate('_js_base') %>
|
||||||
<%= renderTemplate('_preload_roboto') %>
|
<%= renderTemplate('_preload_roboto') %>
|
||||||
|
|
||||||
<script crossorigin="use-credentials">
|
<script>
|
||||||
import("<%= latestCoreJS %>");
|
import("<%= latestCoreJS %>");
|
||||||
import("<%= latestAppJS %>");
|
import("<%= latestAppJS %>");
|
||||||
window.customPanelJS = "<%= latestCustomPanelJS %>";
|
window.customPanelJS = "<%= latestCustomPanelJS %>";
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import { css, CSSResult, html, LitElement, property } from "lit-element";
|
import { css, CSSResult, html, LitElement, property } from "lit-element";
|
||||||
import { removeInitSkeleton } from "../util/init-skeleton";
|
import { removeInitSkeleton } from "../util/init-skeleton";
|
||||||
import "../components/ha-circular-progress";
|
|
||||||
|
|
||||||
class HaInitPage extends LitElement {
|
class HaInitPage extends LitElement {
|
||||||
@property({ type: Boolean }) public error = false;
|
@property({ type: Boolean }) public error = false;
|
||||||
@@ -28,7 +28,7 @@ class HaInitPage extends LitElement {
|
|||||||
: ""}
|
: ""}
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner-lite active></paper-spinner-lite>
|
||||||
<p>Loading data</p>
|
<p>Loading data</p>
|
||||||
`}
|
`}
|
||||||
</div>
|
</div>
|
||||||
@@ -52,7 +52,7 @@ class HaInitPage extends LitElement {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner-lite {
|
||||||
margin-top: 9px;
|
margin-top: 9px;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResultArray,
|
CSSResultArray,
|
||||||
@@ -8,7 +9,6 @@ import {
|
|||||||
property,
|
property,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "../components/ha-circular-progress";
|
|
||||||
import "../components/ha-menu-button";
|
import "../components/ha-menu-button";
|
||||||
import "../components/ha-icon-button-arrow-prev";
|
import "../components/ha-icon-button-arrow-prev";
|
||||||
import { haStyle } from "../resources/styles";
|
import { haStyle } from "../resources/styles";
|
||||||
@@ -39,7 +39,7 @@ class HassLoadingScreen extends LitElement {
|
|||||||
`}
|
`}
|
||||||
</app-toolbar>
|
</app-toolbar>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner-lite active></paper-spinner-lite>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -147,8 +147,6 @@ export class HassRouterPage extends UpdatingElement {
|
|||||||
? routeOptions.load()
|
? routeOptions.load()
|
||||||
: Promise.resolve();
|
: Promise.resolve();
|
||||||
|
|
||||||
let showLoadingScreenTimeout: undefined | number;
|
|
||||||
|
|
||||||
// Check when loading the page source failed.
|
// Check when loading the page source failed.
|
||||||
loadProm.catch((err) => {
|
loadProm.catch((err) => {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
@@ -160,13 +158,7 @@ export class HassRouterPage extends UpdatingElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Removes either loading screen or the panel
|
// Removes either loading screen or the panel
|
||||||
if (this.lastChild) {
|
this.removeChild(this.lastChild!);
|
||||||
this.removeChild(this.lastChild!);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showLoadingScreenTimeout) {
|
|
||||||
clearTimeout(showLoadingScreenTimeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show error screen
|
// Show error screen
|
||||||
const errorEl = document.createElement("hass-error-screen");
|
const errorEl = document.createElement("hass-error-screen");
|
||||||
@@ -185,7 +177,7 @@ export class HassRouterPage extends UpdatingElement {
|
|||||||
// That way we won't have a double fast flash on fast connections.
|
// That way we won't have a double fast flash on fast connections.
|
||||||
let created = false;
|
let created = false;
|
||||||
|
|
||||||
showLoadingScreenTimeout = window.setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (created || this._currentPage !== newPage) {
|
if (created || this._currentPage !== newPage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -2,20 +2,20 @@ import "@polymer/app-layout/app-drawer-layout/app-drawer-layout";
|
|||||||
import type { AppDrawerLayoutElement } from "@polymer/app-layout/app-drawer-layout/app-drawer-layout";
|
import type { AppDrawerLayoutElement } from "@polymer/app-layout/app-drawer-layout/app-drawer-layout";
|
||||||
import "@polymer/app-layout/app-drawer/app-drawer";
|
import "@polymer/app-layout/app-drawer/app-drawer";
|
||||||
import type { AppDrawerElement } from "@polymer/app-layout/app-drawer/app-drawer";
|
import type { AppDrawerElement } from "@polymer/app-layout/app-drawer/app-drawer";
|
||||||
|
import "@polymer/iron-media-query/iron-media-query";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
html,
|
html,
|
||||||
LitElement,
|
LitElement,
|
||||||
property,
|
property,
|
||||||
customElement,
|
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { listenMediaQuery } from "../common/dom/media_query";
|
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import { toggleAttribute } from "../common/dom/toggle_attribute";
|
import { toggleAttribute } from "../common/dom/toggle_attribute";
|
||||||
import { showNotificationDrawer } from "../dialogs/notifications/show-notification-drawer";
|
import { showNotificationDrawer } from "../dialogs/notifications/show-notification-drawer";
|
||||||
|
import type { PolymerChangedEvent } from "../polymer-types";
|
||||||
import type { HomeAssistant, Route } from "../types";
|
import type { HomeAssistant, Route } from "../types";
|
||||||
import "./partial-panel-resolver";
|
import "./partial-panel-resolver";
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@customElement("home-assistant-main")
|
|
||||||
class HomeAssistantMain extends LitElement {
|
class HomeAssistantMain extends LitElement {
|
||||||
@property() public hass!: HomeAssistant;
|
@property() public hass!: HomeAssistant;
|
||||||
|
|
||||||
@@ -50,6 +49,11 @@ class HomeAssistantMain extends LitElement {
|
|||||||
!sidebarNarrow || NON_SWIPABLE_PANELS.indexOf(hass.panelUrl) !== -1;
|
!sidebarNarrow || NON_SWIPABLE_PANELS.indexOf(hass.panelUrl) !== -1;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
|
<iron-media-query
|
||||||
|
query="(max-width: 870px)"
|
||||||
|
@query-matches-changed=${this._narrowChanged}
|
||||||
|
></iron-media-query>
|
||||||
|
|
||||||
<app-drawer-layout
|
<app-drawer-layout
|
||||||
fullbleed
|
fullbleed
|
||||||
.forceNarrow=${sidebarNarrow}
|
.forceNarrow=${sidebarNarrow}
|
||||||
@@ -104,10 +108,6 @@ class HomeAssistantMain extends LitElement {
|
|||||||
narrow: this.narrow!,
|
narrow: this.narrow!,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
listenMediaQuery("(max-width: 870px)", (matches) => {
|
|
||||||
this.narrow = matches;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected updated(changedProps: PropertyValues) {
|
protected updated(changedProps: PropertyValues) {
|
||||||
@@ -131,6 +131,10 @@ class HomeAssistantMain extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _narrowChanged(ev: PolymerChangedEvent<boolean>) {
|
||||||
|
this.narrow = ev.detail.value;
|
||||||
|
}
|
||||||
|
|
||||||
private get _sidebarNarrow() {
|
private get _sidebarNarrow() {
|
||||||
return this.narrow || this.hass.dockedSidebar === "always_hidden";
|
return this.narrow || this.hass.dockedSidebar === "always_hidden";
|
||||||
}
|
}
|
||||||
@@ -166,8 +170,4 @@ class HomeAssistantMain extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
customElements.define("home-assistant-main", HomeAssistantMain);
|
||||||
interface HTMLElementTagNameMap {
|
|
||||||
"home-assistant-main": HomeAssistantMain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import "@polymer/app-route/app-location";
|
import "@polymer/app-route/app-location";
|
||||||
import { html, property, PropertyValues, customElement } from "lit-element";
|
import { html, property, PropertyValues } from "lit-element";
|
||||||
import { navigate } from "../common/navigate";
|
import { navigate } from "../common/navigate";
|
||||||
import { getStorageDefaultPanelUrlPath } from "../data/panel";
|
import { getStorageDefaultPanelUrlPath } from "../data/panel";
|
||||||
import "../resources/custom-card-support";
|
import "../resources/custom-card-support";
|
||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
import "./ha-init-page";
|
import "./ha-init-page";
|
||||||
import "./home-assistant-main";
|
import "./home-assistant-main";
|
||||||
|
|
||||||
@customElement("home-assistant")
|
|
||||||
export class HomeAssistantAppEl extends HassElement {
|
export class HomeAssistantAppEl extends HassElement {
|
||||||
@property() private _route?: Route;
|
@property() private _route?: Route;
|
||||||
|
|
||||||
@@ -22,10 +21,6 @@ export class HomeAssistantAppEl extends HassElement {
|
|||||||
|
|
||||||
private _haVersion?: string;
|
private _haVersion?: string;
|
||||||
|
|
||||||
private _hiddenTimeout?: number;
|
|
||||||
|
|
||||||
private _visiblePromiseResolve?: () => void;
|
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
const hass = this.hass;
|
const hass = this.hass;
|
||||||
|
|
||||||
@@ -75,12 +70,6 @@ export class HomeAssistantAppEl extends HassElement {
|
|||||||
super.hassConnected();
|
super.hassConnected();
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this._loadHassTranslations(this.hass!.language, "state");
|
this._loadHassTranslations(this.hass!.language, "state");
|
||||||
|
|
||||||
document.addEventListener(
|
|
||||||
"visibilitychange",
|
|
||||||
() => this.__handleVisibilityChange(),
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected hassReconnected() {
|
protected hassReconnected() {
|
||||||
@@ -147,37 +136,6 @@ export class HomeAssistantAppEl extends HassElement {
|
|||||||
? route.path.substr(1)
|
? route.path.substr(1)
|
||||||
: route.path.substr(1, dividerPos - 1);
|
: route.path.substr(1, dividerPos - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private __handleVisibilityChange() {
|
|
||||||
if (document.hidden) {
|
|
||||||
// If the document is hidden, we will prevent reconnects until we are visible again
|
|
||||||
this.hass!.connection.suspendReconnectUntil(
|
|
||||||
new Promise((resolve) => {
|
|
||||||
this._visiblePromiseResolve = resolve;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
// We close the connection to Home Assistant after being hidden for 5 minutes
|
|
||||||
this._hiddenTimeout = window.setTimeout(() => {
|
|
||||||
this._hiddenTimeout = undefined;
|
|
||||||
this.hass!.connection.suspend();
|
|
||||||
}, 300000);
|
|
||||||
} else {
|
|
||||||
// Clear timer to close the connection
|
|
||||||
if (this._hiddenTimeout) {
|
|
||||||
clearTimeout(this._hiddenTimeout);
|
|
||||||
this._hiddenTimeout = undefined;
|
|
||||||
}
|
|
||||||
// Unsuspend the reconnect
|
|
||||||
if (this._visiblePromiseResolve) {
|
|
||||||
this._visiblePromiseResolve();
|
|
||||||
this._visiblePromiseResolve = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
customElements.define("home-assistant", HomeAssistantAppEl);
|
||||||
interface HTMLElementTagNameMap {
|
|
||||||
"home-assistant": HomeAssistantAppEl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -6,12 +7,11 @@ import {
|
|||||||
LitElement,
|
LitElement,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "../components/ha-circular-progress";
|
|
||||||
|
|
||||||
@customElement("loading-screen")
|
@customElement("loading-screen")
|
||||||
class LoadingScreen extends LitElement {
|
class LoadingScreen extends LitElement {
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html` <ha-circular-progress active></ha-circular-progress> `;
|
return html` <paper-spinner-lite active></paper-spinner-lite> `;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResult {
|
static get styles(): CSSResult {
|
||||||
|
@@ -2,7 +2,7 @@ import "@material/mwc-button";
|
|||||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
||||||
import "../../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -132,10 +132,10 @@ class DialogThingtalk extends LitElement {
|
|||||||
Skip
|
Skip
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button @click="${this._generate}" .disabled=${this._submitting}>
|
<mwc-button @click="${this._generate}" .disabled=${this._submitting}>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
?active="${this._submitting}"
|
?active="${this._submitting}"
|
||||||
alt="Creating your automation..."
|
alt="Creating your automation..."
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
Create automation
|
Create automation
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -245,15 +245,15 @@ class DialogThingtalk extends LitElement {
|
|||||||
mwc-button.left {
|
mwc-button.left {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
ha-circular-progress[active] {
|
paper-spinner[active] {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.error {
|
.error {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
import "../../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html, LitElement, property, PropertyValues } from "lit-element";
|
import { html, LitElement, property, PropertyValues } from "lit-element";
|
||||||
import "../../../../components/ha-card";
|
import "../../../../components/ha-card";
|
||||||
import "../../../../components/ha-switch";
|
import "../../../../components/ha-switch";
|
||||||
@@ -119,7 +119,7 @@ export class CloudWebhooks extends LitElement {
|
|||||||
${this._progress.includes(entry.webhook_id)
|
${this._progress.includes(entry.webhook_id)
|
||||||
? html`
|
? html`
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: this._cloudHooks![entry.webhook_id]
|
: this._cloudHooks![entry.webhook_id]
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { EntityRegistryEntry } from "../../../data/entity_registry";
|
import { EntityRegistryEntry } from "../../../data/entity_registry";
|
||||||
import type { DialogEntityEditor } from "./dialog-entity-editor";
|
import { DialogEntityEditor } from "./dialog-entity-editor";
|
||||||
|
|
||||||
export interface EntityRegistryDetailDialogParams {
|
export interface EntityRegistryDetailDialogParams {
|
||||||
entry?: EntityRegistryEntry;
|
entry?: EntityRegistryEntry;
|
||||||
|
@@ -2,7 +2,7 @@ import "@material/mwc-button";
|
|||||||
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
|
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
import "@polymer/paper-listbox/paper-listbox";
|
import "@polymer/paper-listbox/paper-listbox";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
@@ -65,10 +65,7 @@ class HaEntityConfig extends PolymerElement {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template is="dom-if" if="[[computeShowSpinner(formState)]]">
|
<template is="dom-if" if="[[computeShowSpinner(formState)]]">
|
||||||
<ha-circular-progress
|
<paper-spinner active="" alt="[[formState]]"></paper-spinner>
|
||||||
active=""
|
|
||||||
alt="[[formState]]"
|
|
||||||
></ha-circular-progress>
|
|
||||||
[[formState]]
|
[[formState]]
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import "../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -46,7 +46,7 @@ class SystemHealthCard extends LitElement {
|
|||||||
sections.push(
|
sections.push(
|
||||||
html`
|
html`
|
||||||
<div class="loading-container">
|
<div class="loading-container">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "../../../../../components/ha-icon-button";
|
import "../../../../../components/ha-icon-button";
|
||||||
import "../../../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -97,10 +97,7 @@ class ZHAAddDevicesPage extends LitElement {
|
|||||||
"ui.panel.config.zha.add_device_page.spinner"
|
"ui.panel.config.zha.add_device_page.spinner"
|
||||||
)}
|
)}
|
||||||
</h1>
|
</h1>
|
||||||
<ha-circular-progress
|
<paper-spinner active alt="Searching"></paper-spinner>
|
||||||
active
|
|
||||||
alt="Searching"
|
|
||||||
></ha-circular-progress>
|
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<div>
|
<div>
|
||||||
@@ -229,7 +226,7 @@ class ZHAAddDevicesPage extends LitElement {
|
|||||||
.error {
|
.error {
|
||||||
color: var(--google-red-500);
|
color: var(--google-red-500);
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
.searching {
|
.searching {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
|
||||||
import "../../../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -104,12 +104,12 @@ export class ZHAAddGroupPage extends LitElement {
|
|||||||
@click="${this._createGroup}"
|
@click="${this._createGroup}"
|
||||||
class="button"
|
class="button"
|
||||||
>
|
>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
?active="${this._processingAdd}"
|
?active="${this._processingAdd}"
|
||||||
alt="${this.hass!.localize(
|
alt="${this.hass!.localize(
|
||||||
"ui.panel.config.zha.groups.creating_group"
|
"ui.panel.config.zha.groups.creating_group"
|
||||||
)}"
|
)}"
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.config.zha.groups.create"
|
"ui.panel.config.zha.groups.create"
|
||||||
)}</mwc-button
|
)}</mwc-button
|
||||||
@@ -171,15 +171,15 @@ export class ZHAAddGroupPage extends LitElement {
|
|||||||
ha-config-section *:last-child {
|
ha-config-section *:last-child {
|
||||||
padding-bottom: 24px;
|
padding-bottom: 24px;
|
||||||
}
|
}
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
ha-circular-progress[active] {
|
paper-spinner[active] {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.paper-dialog-buttons {
|
.paper-dialog-buttons {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "../../../../../components/ha-icon-button";
|
import "../../../../../components/ha-icon-button";
|
||||||
import "../../../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -166,12 +166,12 @@ export class ZHAGroupPage extends LitElement {
|
|||||||
@click="${this._removeMembersFromGroup}"
|
@click="${this._removeMembersFromGroup}"
|
||||||
class="button"
|
class="button"
|
||||||
>
|
>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
?active="${this._processingRemove}"
|
?active="${this._processingRemove}"
|
||||||
alt=${this.hass.localize(
|
alt=${this.hass.localize(
|
||||||
"ui.panel.config.zha.groups.removing_members"
|
"ui.panel.config.zha.groups.removing_members"
|
||||||
)}
|
)}
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.config.zha.groups.remove_members"
|
"ui.panel.config.zha.groups.remove_members"
|
||||||
)}</mwc-button
|
)}</mwc-button
|
||||||
@@ -201,12 +201,12 @@ export class ZHAGroupPage extends LitElement {
|
|||||||
@click="${this._addMembersToGroup}"
|
@click="${this._addMembersToGroup}"
|
||||||
class="button"
|
class="button"
|
||||||
>
|
>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
?active="${this._processingAdd}"
|
?active="${this._processingAdd}"
|
||||||
alt=${this.hass.localize(
|
alt=${this.hass.localize(
|
||||||
"ui.panel.config.zha.groups.adding_members"
|
"ui.panel.config.zha.groups.adding_members"
|
||||||
)}
|
)}
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.config.zha.groups.add_members"
|
"ui.panel.config.zha.groups.add_members"
|
||||||
)}</mwc-button
|
)}</mwc-button
|
||||||
@@ -309,15 +309,15 @@ export class ZHAGroupPage extends LitElement {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
ha-circular-progress[active] {
|
paper-spinner[active] {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.paper-dialog-buttons {
|
.paper-dialog-buttons {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import "../../../../../components/ha-icon-button";
|
import "../../../../../components/ha-icon-button";
|
||||||
import "../../../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
@@ -92,7 +92,7 @@ export class ZwaveNetwork extends LitElement {
|
|||||||
`
|
`
|
||||||
: this._networkStatus.state === ZWAVE_NETWORK_STATE_STARTED
|
: this._networkStatus.state === ZWAVE_NETWORK_STATE_STARTED
|
||||||
? html`
|
? html`
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.config.zwave.network_status.network_starting"
|
"ui.panel.config.zwave.network_status.network_starting"
|
||||||
)}<br />
|
)}<br />
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import "../../../components/ha-icon-button";
|
import "../../../components/ha-icon-button";
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
import "../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -47,7 +47,7 @@ export class SystemLogCard extends LitElement {
|
|||||||
${this._items === undefined
|
${this._items === undefined
|
||||||
? html`
|
? html`
|
||||||
<div class="loading-container">
|
<div class="loading-container">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
|
@@ -112,11 +112,7 @@ export class HaConfigServerControl extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
`
|
`
|
||||||
: html`
|
: html` <paper-spinner active></paper-spinner> `}
|
||||||
<ha-circular-progress
|
|
||||||
active
|
|
||||||
></ha-circular-progress>
|
|
||||||
`}
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
import "../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -138,7 +138,7 @@ export class DialogAddUser extends LitElement {
|
|||||||
${this._loading
|
${this._loading
|
||||||
? html`
|
? html`
|
||||||
<div slot="primaryAction" class="submit-spinner">
|
<div slot="primaryAction" class="submit-spinner">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import "../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { timeOut } from "@polymer/polymer/lib/utils/async";
|
import { timeOut } from "@polymer/polymer/lib/utils/async";
|
||||||
import { Debouncer } from "@polymer/polymer/lib/utils/debounce";
|
import { Debouncer } from "@polymer/polymer/lib/utils/debounce";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
@@ -92,11 +92,10 @@ class HaPanelDevTemplate extends LocalizeMixin(PolymerElement) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="render-pane">
|
<div class="render-pane">
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
class="render-spinner"
|
class="render-spinner"
|
||||||
active="[[rendering]]"
|
active="[[rendering]]"
|
||||||
size="small"
|
></paper-spinner>
|
||||||
></ha-circular-progress>
|
|
||||||
<pre class$="[[computeRenderedClasses(error)]]">[[processed]]</pre>
|
<pre class$="[[computeRenderedClasses(error)]]">[[processed]]</pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -11,7 +11,7 @@ import { HomeAssistant } from "../../types";
|
|||||||
import type { DateRangePickerRanges } from "../../components/ha-date-range-picker";
|
import type { DateRangePickerRanges } from "../../components/ha-date-range-picker";
|
||||||
import "../../components/ha-date-range-picker";
|
import "../../components/ha-date-range-picker";
|
||||||
import { fetchDate, computeHistory } from "../../data/history";
|
import { fetchDate, computeHistory } from "../../data/history";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
|
|
||||||
class HaPanelHistory extends LitElement {
|
class HaPanelHistory extends LitElement {
|
||||||
@property() hass!: HomeAssistant;
|
@property() hass!: HomeAssistant;
|
||||||
@@ -73,10 +73,10 @@ class HaPanelHistory extends LitElement {
|
|||||||
></ha-date-range-picker>
|
></ha-date-range-picker>
|
||||||
</div>
|
</div>
|
||||||
${this._isLoading
|
${this._isLoading
|
||||||
? html`<ha-circular-progress
|
? html`<paper-spinner
|
||||||
active
|
active
|
||||||
alt=${this.hass.localize("ui.common.loading")}
|
alt=${this.hass.localize("ui.common.loading")}
|
||||||
></ha-circular-progress>`
|
></paper-spinner>`
|
||||||
: html`
|
: html`
|
||||||
<state-history-charts
|
<state-history-charts
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@@ -190,7 +190,7 @@ class HaPanelHistory extends LitElement {
|
|||||||
.content {
|
.content {
|
||||||
padding: 0 16px 16px;
|
padding: 0 16px 16px;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
@@ -2,7 +2,7 @@ import "@polymer/app-layout/app-header-layout/app-header-layout";
|
|||||||
import "@polymer/app-layout/app-header/app-header";
|
import "@polymer/app-layout/app-header/app-header";
|
||||||
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
||||||
import "../../components/ha-icon-button";
|
import "../../components/ha-icon-button";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { computeRTL } from "../../common/util/compute_rtl";
|
import { computeRTL } from "../../common/util/compute_rtl";
|
||||||
import "../../components/entity/ha-entity-picker";
|
import "../../components/entity/ha-entity-picker";
|
||||||
import "../../components/ha-menu-button";
|
import "../../components/ha-menu-button";
|
||||||
@@ -105,10 +105,10 @@ export class HaPanelLogbook extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
${this._isLoading
|
${this._isLoading
|
||||||
? html`<ha-circular-progress
|
? html`<paper-spinner
|
||||||
active
|
active
|
||||||
alt=${this.hass.localize("ui.common.loading")}
|
alt=${this.hass.localize("ui.common.loading")}
|
||||||
></ha-circular-progress>`
|
></paper-spinner>`
|
||||||
: html`<ha-logbook
|
: html`<ha-logbook
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.entries=${this._entries}
|
.entries=${this._entries}
|
||||||
@@ -239,7 +239,7 @@ export class HaPanelLogbook extends LitElement {
|
|||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
@@ -1,392 +0,0 @@
|
|||||||
import "../../../components/ha-icon-button";
|
|
||||||
import "@thomasloven/round-slider";
|
|
||||||
import { HassEntity } from "home-assistant-js-websocket";
|
|
||||||
import {
|
|
||||||
css,
|
|
||||||
CSSResult,
|
|
||||||
customElement,
|
|
||||||
html,
|
|
||||||
LitElement,
|
|
||||||
property,
|
|
||||||
PropertyValues,
|
|
||||||
svg,
|
|
||||||
TemplateResult,
|
|
||||||
} from "lit-element";
|
|
||||||
import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element";
|
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
|
||||||
import { computeStateName } from "../../../common/entity/compute_state_name";
|
|
||||||
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
|
||||||
import "../../../components/ha-card";
|
|
||||||
import { HumidifierEntity } from "../../../data/humidifier";
|
|
||||||
import { UNAVAILABLE_STATES } from "../../../data/entity";
|
|
||||||
import { HomeAssistant } from "../../../types";
|
|
||||||
import { findEntities } from "../common/find-entites";
|
|
||||||
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
|
||||||
import { createEntityNotFoundWarning } from "../components/hui-warning";
|
|
||||||
import { LovelaceCard, LovelaceCardEditor } from "../types";
|
|
||||||
import { HumidifierCardConfig } from "./types";
|
|
||||||
|
|
||||||
@customElement("hui-humidifier-card")
|
|
||||||
export class HuiHumidifierCard extends LitElement implements LovelaceCard {
|
|
||||||
public static async getConfigElement(): Promise<LovelaceCardEditor> {
|
|
||||||
await import(
|
|
||||||
/* webpackChunkName: "hui-humidifier-card-editor" */ "../editor/config-elements/hui-humidifier-card-editor"
|
|
||||||
);
|
|
||||||
return document.createElement("hui-humidifier-card-editor");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static getStubConfig(
|
|
||||||
hass: HomeAssistant,
|
|
||||||
entities: string[],
|
|
||||||
entitiesFallback: string[]
|
|
||||||
): HumidifierCardConfig {
|
|
||||||
const includeDomains = ["humidifier"];
|
|
||||||
const maxEntities = 1;
|
|
||||||
const foundEntities = findEntities(
|
|
||||||
hass,
|
|
||||||
maxEntities,
|
|
||||||
entities,
|
|
||||||
entitiesFallback,
|
|
||||||
includeDomains
|
|
||||||
);
|
|
||||||
|
|
||||||
return { type: "humidifier", entity: foundEntities[0] || "" };
|
|
||||||
}
|
|
||||||
|
|
||||||
@property() public hass?: HomeAssistant;
|
|
||||||
|
|
||||||
@property() private _config?: HumidifierCardConfig;
|
|
||||||
|
|
||||||
@property() private _setHum?: number;
|
|
||||||
|
|
||||||
public getCardSize(): number {
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
public setConfig(config: HumidifierCardConfig): void {
|
|
||||||
if (!config.entity || config.entity.split(".")[0] !== "humidifier") {
|
|
||||||
throw new Error("Specify an entity from within the humidifier domain.");
|
|
||||||
}
|
|
||||||
|
|
||||||
this._config = config;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
|
||||||
if (!this.hass || !this._config) {
|
|
||||||
return html``;
|
|
||||||
}
|
|
||||||
const stateObj = this.hass.states[this._config.entity] as HumidifierEntity;
|
|
||||||
|
|
||||||
if (!stateObj) {
|
|
||||||
return html`
|
|
||||||
<hui-warning>
|
|
||||||
${createEntityNotFoundWarning(this.hass, this._config.entity)}
|
|
||||||
</hui-warning>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const name =
|
|
||||||
this._config!.name ||
|
|
||||||
computeStateName(this.hass!.states[this._config!.entity]);
|
|
||||||
const targetHumidity =
|
|
||||||
stateObj.attributes.humidity !== null &&
|
|
||||||
Number.isFinite(Number(stateObj.attributes.humidity))
|
|
||||||
? stateObj.attributes.humidity
|
|
||||||
: stateObj.attributes.min_humidity;
|
|
||||||
|
|
||||||
const rtlDirection = computeRTLDirection(this.hass);
|
|
||||||
|
|
||||||
const slider = UNAVAILABLE_STATES.includes(stateObj.state)
|
|
||||||
? html` <round-slider disabled="true"></round-slider> `
|
|
||||||
: html`
|
|
||||||
<round-slider
|
|
||||||
.value=${targetHumidity}
|
|
||||||
.min=${stateObj.attributes.min_humidity}
|
|
||||||
.max=${stateObj.attributes.max_humidity}
|
|
||||||
.rtl=${rtlDirection === "rtl"}
|
|
||||||
.step="1"
|
|
||||||
@value-changing=${this._dragEvent}
|
|
||||||
@value-changed=${this._setHumidity}
|
|
||||||
></round-slider>
|
|
||||||
`;
|
|
||||||
|
|
||||||
const setValues = svg`
|
|
||||||
<svg viewBox="0 0 40 20">
|
|
||||||
<text
|
|
||||||
x="50%"
|
|
||||||
dx="1"
|
|
||||||
y="60%"
|
|
||||||
text-anchor="middle"
|
|
||||||
style="font-size: 13px;"
|
|
||||||
class="set-value"
|
|
||||||
>
|
|
||||||
${
|
|
||||||
UNAVAILABLE_STATES.includes(stateObj.state) ||
|
|
||||||
this._setHum === undefined ||
|
|
||||||
this._setHum === null
|
|
||||||
? ""
|
|
||||||
: svg`
|
|
||||||
${this._setHum.toFixed()}
|
|
||||||
<tspan dx="-3" dy="-6.5" style="font-size: 4px;">
|
|
||||||
%
|
|
||||||
</tspan>
|
|
||||||
`
|
|
||||||
}
|
|
||||||
</text>
|
|
||||||
</svg>
|
|
||||||
<svg id="set-values">
|
|
||||||
<g>
|
|
||||||
<text
|
|
||||||
dy="22"
|
|
||||||
text-anchor="middle"
|
|
||||||
id="set-mode"
|
|
||||||
>
|
|
||||||
${this.hass!.localize(`state.default.${stateObj.state}`)}
|
|
||||||
${
|
|
||||||
stateObj.attributes.mode &&
|
|
||||||
!UNAVAILABLE_STATES.includes(stateObj.state)
|
|
||||||
? html`
|
|
||||||
-
|
|
||||||
${this.hass!.localize(
|
|
||||||
`state_attributes.humidifier.mode.${stateObj.attributes.mode}`
|
|
||||||
) || stateObj.attributes.mode}
|
|
||||||
`
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
`;
|
|
||||||
|
|
||||||
return html`
|
|
||||||
<ha-card>
|
|
||||||
<ha-icon-button
|
|
||||||
icon="hass:dots-vertical"
|
|
||||||
class="more-info"
|
|
||||||
@click=${this._handleMoreInfo}
|
|
||||||
tabindex="0"
|
|
||||||
></ha-icon-button>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<div id="controls">
|
|
||||||
<div id="slider">
|
|
||||||
${slider}
|
|
||||||
<div id="slider-center">
|
|
||||||
<div id="humidity">
|
|
||||||
${setValues}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="info">
|
|
||||||
${name}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ha-card>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected shouldUpdate(changedProps: PropertyValues): boolean {
|
|
||||||
return hasConfigOrEntityChanged(this, changedProps);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected updated(changedProps: PropertyValues): void {
|
|
||||||
super.updated(changedProps);
|
|
||||||
|
|
||||||
if (
|
|
||||||
!this._config ||
|
|
||||||
!this.hass ||
|
|
||||||
(!changedProps.has("hass") && !changedProps.has("_config"))
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
|
||||||
const oldConfig = changedProps.get("_config") as
|
|
||||||
| HumidifierCardConfig
|
|
||||||
| undefined;
|
|
||||||
|
|
||||||
if (
|
|
||||||
!oldHass ||
|
|
||||||
!oldConfig ||
|
|
||||||
oldHass.themes !== this.hass.themes ||
|
|
||||||
oldConfig.theme !== this._config.theme
|
|
||||||
) {
|
|
||||||
applyThemesOnElement(this, this.hass.themes, this._config.theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
const stateObj = this.hass.states[this._config.entity];
|
|
||||||
if (!stateObj) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!oldHass || oldHass.states[this._config.entity] !== stateObj) {
|
|
||||||
this._setHum = this._getSetHum(stateObj);
|
|
||||||
this._rescale_svg();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private _rescale_svg() {
|
|
||||||
// Set the viewbox of the SVG containing the set humidity to perfectly
|
|
||||||
// fit the text
|
|
||||||
// That way it will auto-scale correctly
|
|
||||||
// This is not done to the SVG containing the current humidity, because
|
|
||||||
// it should not be centered on the text, but only on the value
|
|
||||||
if (this.shadowRoot && this.shadowRoot.querySelector("ha-card")) {
|
|
||||||
(this.shadowRoot.querySelector(
|
|
||||||
"ha-card"
|
|
||||||
) as LitElement).updateComplete.then(() => {
|
|
||||||
const svgRoot = this.shadowRoot!.querySelector("#set-values");
|
|
||||||
const box = svgRoot!.querySelector("g")!.getBBox();
|
|
||||||
svgRoot!.setAttribute(
|
|
||||||
"viewBox",
|
|
||||||
`${box!.x} ${box!.y} ${box!.width} ${box!.height}`
|
|
||||||
);
|
|
||||||
svgRoot!.setAttribute("width", `${box!.width}`);
|
|
||||||
svgRoot!.setAttribute("height", `${box!.height}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private _getSetHum(stateObj: HassEntity): undefined | number {
|
|
||||||
if (UNAVAILABLE_STATES.includes(stateObj.state)) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stateObj.attributes.humidity;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _dragEvent(e): void {
|
|
||||||
this._setHum = e.detail.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _setHumidity(e): void {
|
|
||||||
this.hass!.callService("humidifier", "set_humidity", {
|
|
||||||
entity_id: this._config!.entity,
|
|
||||||
humidity: e.detail.value,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private _handleMoreInfo() {
|
|
||||||
fireEvent(this, "hass-more-info", {
|
|
||||||
entityId: this._config!.entity,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
static get styles(): CSSResult {
|
|
||||||
return css`
|
|
||||||
:host {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
ha-card {
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
--name-font-size: 1.2rem;
|
|
||||||
--brightness-font-size: 1.2rem;
|
|
||||||
--rail-border-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.more-info {
|
|
||||||
position: absolute;
|
|
||||||
cursor: pointer;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
border-radius: 100%;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
z-index: 25;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#controls {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 16px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
#slider {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
max-width: 250px;
|
|
||||||
min-width: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
round-slider {
|
|
||||||
--round-slider-path-color: var(--disabled-text-color);
|
|
||||||
--round-slider-bar-color: var(--mode-color);
|
|
||||||
padding-bottom: 10%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#slider-center {
|
|
||||||
position: absolute;
|
|
||||||
width: calc(100% - 40px);
|
|
||||||
height: calc(100% - 40px);
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 100%;
|
|
||||||
left: 20px;
|
|
||||||
top: 20px;
|
|
||||||
text-align: center;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#humidity {
|
|
||||||
position: absolute;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
width: 100%;
|
|
||||||
height: 50%;
|
|
||||||
top: 45%;
|
|
||||||
left: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#set-values {
|
|
||||||
max-width: 80%;
|
|
||||||
transform: translate(0, -50%);
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#set-mode {
|
|
||||||
fill: var(--secondary-text-color);
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#info {
|
|
||||||
display: flex-vertical;
|
|
||||||
justify-content: center;
|
|
||||||
text-align: center;
|
|
||||||
padding: 16px;
|
|
||||||
margin-top: -60px;
|
|
||||||
font-size: var(--name-font-size);
|
|
||||||
}
|
|
||||||
|
|
||||||
#modes > * {
|
|
||||||
color: var(--disabled-text-color);
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#modes .selected-icon {
|
|
||||||
color: var(--mode-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
fill: var(--primary-text-color);
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface HTMLElementTagNameMap {
|
|
||||||
"hui-humidifier-card": HuiHumidifierCard;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -10,10 +10,10 @@ import {
|
|||||||
PropertyValues,
|
PropertyValues,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "../../../components/ha-card";
|
import "../../../components/ha-card";
|
||||||
import "../../../components/ha-circular-progress";
|
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { LovelaceCard } from "../types";
|
import { LovelaceCard } from "../types";
|
||||||
import { LovelaceCardConfig } from "../../../data/lovelace";
|
import { LovelaceCardConfig } from "../../../data/lovelace";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner-lite";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { STATE_NOT_RUNNING } from "home-assistant-js-websocket";
|
import { STATE_NOT_RUNNING } from "home-assistant-js-websocket";
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ export class HuiStartingCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner-lite active></paper-spinner-lite>
|
||||||
${this.hass.localize("ui.panel.lovelace.cards.starting.description")}
|
${this.hass.localize("ui.panel.lovelace.cards.starting.description")}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@@ -59,7 +59,7 @@ export class HuiStartingCard extends LitElement implements LovelaceCard {
|
|||||||
display: block;
|
display: block;
|
||||||
height: calc(100vh - 64px);
|
height: calc(100vh - 64px);
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner-lite {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
|
@@ -133,12 +133,6 @@ export interface GlanceCardConfig extends LovelaceCardConfig {
|
|||||||
state_color?: boolean;
|
state_color?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HumidifierCardConfig extends LovelaceCardConfig {
|
|
||||||
entity: string;
|
|
||||||
theme?: string;
|
|
||||||
name?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IframeCardConfig extends LovelaceCardConfig {
|
export interface IframeCardConfig extends LovelaceCardConfig {
|
||||||
aspect_ratio?: string;
|
aspect_ratio?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
|
@@ -37,7 +37,6 @@ import { GroupEntity, HomeAssistant } from "../../../types";
|
|||||||
import {
|
import {
|
||||||
AlarmPanelCardConfig,
|
AlarmPanelCardConfig,
|
||||||
EntitiesCardConfig,
|
EntitiesCardConfig,
|
||||||
HumidifierCardConfig,
|
|
||||||
LightCardConfig,
|
LightCardConfig,
|
||||||
PictureEntityCardConfig,
|
PictureEntityCardConfig,
|
||||||
ThermostatCardConfig,
|
ThermostatCardConfig,
|
||||||
@@ -151,12 +150,6 @@ export const computeCards = (
|
|||||||
refresh_interval: stateObj.attributes.refresh,
|
refresh_interval: stateObj.attributes.refresh,
|
||||||
};
|
};
|
||||||
cards.push(cardConfig);
|
cards.push(cardConfig);
|
||||||
} else if (domain === "humidifier") {
|
|
||||||
const cardConfig: HumidifierCardConfig = {
|
|
||||||
type: "humidifier",
|
|
||||||
entity: entityId,
|
|
||||||
};
|
|
||||||
cards.push(cardConfig);
|
|
||||||
} else if (domain === "light" && single) {
|
} else if (domain === "light" && single) {
|
||||||
const cardConfig: LightCardConfig = {
|
const cardConfig: LightCardConfig = {
|
||||||
type: "light",
|
type: "light",
|
||||||
|
@@ -38,7 +38,6 @@ const LAZY_LOAD_TYPES = {
|
|||||||
"empty-state": () => import("../cards/hui-empty-state-card"),
|
"empty-state": () => import("../cards/hui-empty-state-card"),
|
||||||
starting: () => import("../cards/hui-starting-card"),
|
starting: () => import("../cards/hui-starting-card"),
|
||||||
"entity-filter": () => import("../cards/hui-entity-filter-card"),
|
"entity-filter": () => import("../cards/hui-entity-filter-card"),
|
||||||
humidifier: () => import("../cards/hui-humidifier-card"),
|
|
||||||
"media-control": () => import("../cards/hui-media-control-card"),
|
"media-control": () => import("../cards/hui-media-control-card"),
|
||||||
"picture-elements": () => import("../cards/hui-picture-elements-card"),
|
"picture-elements": () => import("../cards/hui-picture-elements-card"),
|
||||||
"picture-entity": () => import("../cards/hui-picture-entity-card"),
|
"picture-entity": () => import("../cards/hui-picture-entity-card"),
|
||||||
|
@@ -51,7 +51,6 @@ const DOMAIN_TO_ELEMENT_TYPE = {
|
|||||||
cover: "cover",
|
cover: "cover",
|
||||||
fan: "toggle",
|
fan: "toggle",
|
||||||
group: "group",
|
group: "group",
|
||||||
humidifier: "toggle",
|
|
||||||
input_boolean: "toggle",
|
input_boolean: "toggle",
|
||||||
input_number: "input-number",
|
input_number: "input-number",
|
||||||
input_select: "input-select",
|
input_select: "input-select",
|
||||||
|
@@ -140,11 +140,11 @@ export class HuiCardEditor extends LitElement {
|
|||||||
<div class="gui-editor">
|
<div class="gui-editor">
|
||||||
${this._loading
|
${this._loading
|
||||||
? html`
|
? html`
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
active
|
active
|
||||||
alt="Loading"
|
alt="Loading"
|
||||||
class="center margin-bot"
|
class="center margin-bot"
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
`
|
`
|
||||||
: this._configElement}
|
: this._configElement}
|
||||||
</div>
|
</div>
|
||||||
@@ -303,7 +303,7 @@ export class HuiCardEditor extends LitElement {
|
|||||||
.warning {
|
.warning {
|
||||||
color: #ffa726;
|
color: #ffa726;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
@@ -210,7 +210,7 @@ export class HuiCardPicker extends LitElement {
|
|||||||
this._renderCardElement(card),
|
this._renderCardElement(card),
|
||||||
html`
|
html`
|
||||||
<div class="card spinner">
|
<div class="card spinner">
|
||||||
<ha-circular-progress active alt="Loading"></ha-circular-progress>
|
<paper-spinner active alt="Loading"></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)}`,
|
)}`,
|
||||||
|
@@ -17,7 +17,6 @@ import type {
|
|||||||
LovelaceViewConfig,
|
LovelaceViewConfig,
|
||||||
} from "../../../../data/lovelace";
|
} from "../../../../data/lovelace";
|
||||||
import { haStyleDialog } from "../../../../resources/styles";
|
import { haStyleDialog } from "../../../../resources/styles";
|
||||||
import "../../../../components/ha-circular-progress";
|
|
||||||
import type { HomeAssistant } from "../../../../types";
|
import type { HomeAssistant } from "../../../../types";
|
||||||
import { showSaveSuccessToast } from "../../../../util/toast-saved-success";
|
import { showSaveSuccessToast } from "../../../../util/toast-saved-success";
|
||||||
import { addCard, replaceCard } from "../config-util";
|
import { addCard, replaceCard } from "../config-util";
|
||||||
@@ -168,10 +167,10 @@ export class HuiDialogEditCard extends LitElement {
|
|||||||
></hui-card-preview>
|
></hui-card-preview>
|
||||||
${this._error
|
${this._error
|
||||||
? html`
|
? html`
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
active
|
active
|
||||||
alt="Can't update card"
|
alt="Can't update card"
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
`
|
`
|
||||||
: ``}
|
: ``}
|
||||||
</div>
|
</div>
|
||||||
@@ -206,10 +205,7 @@ export class HuiDialogEditCard extends LitElement {
|
|||||||
>
|
>
|
||||||
${this._saving
|
${this._saving
|
||||||
? html`
|
? html`
|
||||||
<ha-circular-progress
|
<paper-spinner active alt="Saving"></paper-spinner>
|
||||||
active
|
|
||||||
alt="Saving"
|
|
||||||
></ha-circular-progress>
|
|
||||||
`
|
`
|
||||||
: this.hass!.localize("ui.common.save")}
|
: this.hass!.localize("ui.common.save")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
@@ -290,7 +286,7 @@ export class HuiDialogEditCard extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
@@ -307,7 +303,7 @@ export class HuiDialogEditCard extends LitElement {
|
|||||||
.element-preview {
|
.element-preview {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.element-preview ha-circular-progress {
|
.element-preview paper-spinner {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@@ -111,10 +111,7 @@ export class HuiDialogSuggestCard extends LitElement {
|
|||||||
<mwc-button ?disabled="${this._saving}" @click="${this._save}">
|
<mwc-button ?disabled="${this._saving}" @click="${this._save}">
|
||||||
${this._saving
|
${this._saving
|
||||||
? html`
|
? html`
|
||||||
<ha-circular-progress
|
<paper-spinner active alt="Saving"></paper-spinner>
|
||||||
active
|
|
||||||
alt="Saving"
|
|
||||||
></ha-circular-progress>
|
|
||||||
`
|
`
|
||||||
: this.hass!.localize(
|
: this.hass!.localize(
|
||||||
"ui.panel.lovelace.editor.suggest_card.add"
|
"ui.panel.lovelace.editor.suggest_card.add"
|
||||||
@@ -146,7 +143,7 @@ export class HuiDialogSuggestCard extends LitElement {
|
|||||||
ha-paper-dialog {
|
ha-paper-dialog {
|
||||||
max-width: 845px;
|
max-width: 845px;
|
||||||
}
|
}
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
|
@@ -1,117 +0,0 @@
|
|||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import {
|
|
||||||
customElement,
|
|
||||||
html,
|
|
||||||
LitElement,
|
|
||||||
property,
|
|
||||||
TemplateResult,
|
|
||||||
} from "lit-element";
|
|
||||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
|
||||||
import "../../../../components/entity/ha-entity-picker";
|
|
||||||
import { HomeAssistant } from "../../../../types";
|
|
||||||
import { HumidifierCardConfig } from "../../cards/types";
|
|
||||||
import { struct } from "../../common/structs/struct";
|
|
||||||
import "../../components/hui-theme-select-editor";
|
|
||||||
import { LovelaceCardEditor } from "../../types";
|
|
||||||
import { EditorTarget, EntitiesEditorEvent } from "../types";
|
|
||||||
import { configElementStyle } from "./config-elements-style";
|
|
||||||
|
|
||||||
const cardConfigStruct = struct({
|
|
||||||
type: "string",
|
|
||||||
entity: "string",
|
|
||||||
name: "string?",
|
|
||||||
theme: "string?",
|
|
||||||
});
|
|
||||||
|
|
||||||
const includeDomains = ["humidifier"];
|
|
||||||
|
|
||||||
@customElement("hui-humidifier-card-editor")
|
|
||||||
export class HuiHumidifierCardEditor extends LitElement
|
|
||||||
implements LovelaceCardEditor {
|
|
||||||
@property() public hass?: HomeAssistant;
|
|
||||||
|
|
||||||
@property() private _config?: HumidifierCardConfig;
|
|
||||||
|
|
||||||
public setConfig(config: HumidifierCardConfig): void {
|
|
||||||
config = cardConfigStruct(config);
|
|
||||||
this._config = config;
|
|
||||||
}
|
|
||||||
|
|
||||||
get _entity(): string {
|
|
||||||
return this._config!.entity || "";
|
|
||||||
}
|
|
||||||
|
|
||||||
get _name(): string {
|
|
||||||
return this._config!.name || "";
|
|
||||||
}
|
|
||||||
|
|
||||||
get _theme(): string {
|
|
||||||
return this._config!.theme || "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
|
||||||
if (!this.hass || !this._config) {
|
|
||||||
return html``;
|
|
||||||
}
|
|
||||||
|
|
||||||
return html`
|
|
||||||
${configElementStyle}
|
|
||||||
<div class="card-config">
|
|
||||||
<ha-entity-picker
|
|
||||||
.label="${this.hass.localize(
|
|
||||||
"ui.panel.lovelace.editor.card.generic.entity"
|
|
||||||
)} (${this.hass.localize(
|
|
||||||
"ui.panel.lovelace.editor.card.config.required"
|
|
||||||
)})"
|
|
||||||
.hass=${this.hass}
|
|
||||||
.value="${this._entity}"
|
|
||||||
.configValue=${"entity"}
|
|
||||||
.includeDomains=${includeDomains}
|
|
||||||
@change="${this._valueChanged}"
|
|
||||||
allow-custom-entity
|
|
||||||
></ha-entity-picker>
|
|
||||||
<paper-input
|
|
||||||
.label="${this.hass.localize(
|
|
||||||
"ui.panel.lovelace.editor.card.generic.name"
|
|
||||||
)} (${this.hass.localize(
|
|
||||||
"ui.panel.lovelace.editor.card.config.optional"
|
|
||||||
)})"
|
|
||||||
.value="${this._name}"
|
|
||||||
.configValue="${"name"}"
|
|
||||||
@value-changed="${this._valueChanged}"
|
|
||||||
></paper-input>
|
|
||||||
<hui-theme-select-editor
|
|
||||||
.hass=${this.hass}
|
|
||||||
.value="${this._theme}"
|
|
||||||
.configValue="${"theme"}"
|
|
||||||
@value-changed="${this._valueChanged}"
|
|
||||||
></hui-theme-select-editor>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _valueChanged(ev: EntitiesEditorEvent): void {
|
|
||||||
if (!this._config || !this.hass) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const target = ev.target! as EditorTarget;
|
|
||||||
|
|
||||||
if (this[`_${target.configValue}`] === target.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (target.configValue) {
|
|
||||||
if (target.value === "") {
|
|
||||||
delete this._config[target.configValue!];
|
|
||||||
} else {
|
|
||||||
this._config = { ...this._config, [target.configValue!]: target.value };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fireEvent(this, "config-changed", { config: this._config });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface HTMLElementTagNameMap {
|
|
||||||
"hui-humidifier-card-editor": HuiHumidifierCardEditor;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
import "../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -118,10 +118,10 @@ export class HuiSaveConfig extends LitElement {
|
|||||||
?disabled="${this._saving}"
|
?disabled="${this._saving}"
|
||||||
@click="${this._saveConfig}"
|
@click="${this._saveConfig}"
|
||||||
>
|
>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
?active="${this._saving}"
|
?active="${this._saving}"
|
||||||
alt="Saving"
|
alt="Saving"
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
"ui.panel.lovelace.editor.save_config.save"
|
"ui.panel.lovelace.editor.save_config.save"
|
||||||
)}
|
)}
|
||||||
@@ -195,13 +195,13 @@ export class HuiSaveConfig extends LitElement {
|
|||||||
ha-paper-dialog {
|
ha-paper-dialog {
|
||||||
max-width: 650px;
|
max-width: 650px;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
ha-circular-progress[active] {
|
paper-spinner[active] {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
|
@@ -29,10 +29,6 @@ export const coreCards: Card[] = [
|
|||||||
type: "history-graph",
|
type: "history-graph",
|
||||||
showElement: true,
|
showElement: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: "humidifier",
|
|
||||||
showElement: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: "light",
|
type: "light",
|
||||||
showElement: true,
|
showElement: true,
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -10,7 +11,6 @@ import {
|
|||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import "../../../../components/dialog/ha-paper-dialog";
|
import "../../../../components/dialog/ha-paper-dialog";
|
||||||
import "../../../../components/ha-circular-progress";
|
|
||||||
import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog";
|
import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog";
|
||||||
import type { LovelaceConfig } from "../../../../data/lovelace";
|
import type { LovelaceConfig } from "../../../../data/lovelace";
|
||||||
import { haStyleDialog } from "../../../../resources/styles";
|
import { haStyleDialog } from "../../../../resources/styles";
|
||||||
@@ -75,10 +75,10 @@ export class HuiDialogEditLovelace extends LitElement {
|
|||||||
?disabled="${!this._config || this._saving}"
|
?disabled="${!this._config || this._saving}"
|
||||||
@click="${this._save}"
|
@click="${this._save}"
|
||||||
>
|
>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
?active="${this._saving}"
|
?active="${this._saving}"
|
||||||
alt="Saving"
|
alt="Saving"
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
${this.hass!.localize("ui.common.save")}</mwc-button
|
${this.hass!.localize("ui.common.save")}</mwc-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@@ -148,15 +148,15 @@ export class HuiDialogEditLovelace extends LitElement {
|
|||||||
ha-paper-dialog {
|
ha-paper-dialog {
|
||||||
max-width: 650px;
|
max-width: 650px;
|
||||||
}
|
}
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
ha-circular-progress[active] {
|
paper-spinner[active] {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
import "../../../../components/ha-icon-button";
|
import "../../../../components/ha-icon-button";
|
||||||
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import "@polymer/paper-tabs/paper-tab";
|
import "@polymer/paper-tabs/paper-tab";
|
||||||
import "@polymer/paper-tabs/paper-tabs";
|
import "@polymer/paper-tabs/paper-tabs";
|
||||||
import {
|
import {
|
||||||
@@ -15,7 +16,6 @@ import {
|
|||||||
import { fireEvent, HASSDomEvent } from "../../../../common/dom/fire_event";
|
import { fireEvent, HASSDomEvent } from "../../../../common/dom/fire_event";
|
||||||
import { navigate } from "../../../../common/navigate";
|
import { navigate } from "../../../../common/navigate";
|
||||||
import "../../../../components/dialog/ha-paper-dialog";
|
import "../../../../components/dialog/ha-paper-dialog";
|
||||||
import "../../../../components/ha-circular-progress";
|
|
||||||
import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog";
|
import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog";
|
||||||
import type {
|
import type {
|
||||||
LovelaceBadgeConfig,
|
LovelaceBadgeConfig,
|
||||||
@@ -199,10 +199,10 @@ export class HuiDialogEditView extends LitElement {
|
|||||||
?disabled="${!this._config || this._saving}"
|
?disabled="${!this._config || this._saving}"
|
||||||
@click="${this._save}"
|
@click="${this._save}"
|
||||||
>
|
>
|
||||||
<ha-circular-progress
|
<paper-spinner
|
||||||
?active="${this._saving}"
|
?active="${this._saving}"
|
||||||
alt="Saving"
|
alt="Saving"
|
||||||
></ha-circular-progress>
|
></paper-spinner>
|
||||||
${this.hass!.localize("ui.common.save")}</mwc-button
|
${this.hass!.localize("ui.common.save")}</mwc-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@@ -369,7 +369,7 @@ export class HuiDialogEditView extends LitElement {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
mwc-button ha-circular-progress {
|
mwc-button paper-spinner {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
@@ -377,10 +377,10 @@ export class HuiDialogEditView extends LitElement {
|
|||||||
mwc-button.warning {
|
mwc-button.warning {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
ha-circular-progress[active] {
|
paper-spinner[active] {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
paper-dialog-scrollable {
|
paper-dialog-scrollable {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import "../../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { HassEntity } from "home-assistant-js-websocket";
|
import { HassEntity } from "home-assistant-js-websocket";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
@@ -74,7 +74,7 @@ export class HuiGraphHeaderFooter extends LitElement
|
|||||||
if (!this._coordinates) {
|
if (!this._coordinates) {
|
||||||
return html`
|
return html`
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ export class HuiGraphHeaderFooter extends LitElement
|
|||||||
|
|
||||||
static get styles(): CSSResult {
|
static get styles(): CSSResult {
|
||||||
return css`
|
return css`
|
||||||
ha-circular-progress {
|
paper-spinner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: calc(50% - 28px);
|
top: calc(50% - 28px);
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@ import "@polymer/app-layout/app-header-layout/app-header-layout";
|
|||||||
import "@polymer/app-layout/app-header/app-header";
|
import "@polymer/app-layout/app-header/app-header";
|
||||||
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
import "@polymer/app-layout/app-toolbar/app-toolbar";
|
||||||
import "../../components/ha-icon-button";
|
import "../../components/ha-icon-button";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { safeDump, safeLoad } from "js-yaml";
|
import { safeDump, safeLoad } from "js-yaml";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
@@ -54,7 +54,7 @@ class HaDialogShowAudioMessage extends LocalizeMixin(PolymerElement) {
|
|||||||
[[localize('ui.panel.mailbox.playback_title')]]
|
[[localize('ui.panel.mailbox.playback_title')]]
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<template is="dom-if" if="[[_loading]]">
|
<template is="dom-if" if="[[_loading]]">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</template>
|
</template>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
id="delicon"
|
id="delicon"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-dialog/paper-dialog";
|
import "@polymer/paper-dialog/paper-dialog";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
@@ -71,7 +71,7 @@ class HaChangePasswordCard extends LocalizeMixin(PolymerElement) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<template is="dom-if" if="[[_loading]]">
|
<template is="dom-if" if="[[_loading]]">
|
||||||
<div><ha-circular-progress active></ha-circular-progress></div>
|
<div><paper-spinner active></paper-spinner></div>
|
||||||
</template>
|
</template>
|
||||||
<template is="dom-if" if="[[!_loading]]">
|
<template is="dom-if" if="[[!_loading]]">
|
||||||
<mwc-button on-click="_changePassword"
|
<mwc-button on-click="_changePassword"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
import "../../components/ha-circular-progress";
|
import "@polymer/paper-spinner/paper-spinner";
|
||||||
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
import { html } from "@polymer/polymer/lib/utils/html-tag";
|
||||||
/* eslint-plugin-disable lit */
|
/* eslint-plugin-disable lit */
|
||||||
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
import { PolymerElement } from "@polymer/polymer/polymer-element";
|
||||||
@@ -70,7 +70,7 @@ class HaMfaModuleSetupFlow extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
</template>
|
</template>
|
||||||
<template is="dom-if" if="[[!_step]]">
|
<template is="dom-if" if="[[!_step]]">
|
||||||
<div class="init-spinner">
|
<div class="init-spinner">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template is="dom-if" if="[[_step]]">
|
<template is="dom-if" if="[[_step]]">
|
||||||
@@ -125,7 +125,7 @@ class HaMfaModuleSetupFlow extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
<template is="dom-if" if="[[_equals(_step.type, 'form')]]">
|
<template is="dom-if" if="[[_equals(_step.type, 'form')]]">
|
||||||
<template is="dom-if" if="[[_loading]]">
|
<template is="dom-if" if="[[_loading]]">
|
||||||
<div class="submit-spinner">
|
<div class="submit-spinner">
|
||||||
<ha-circular-progress active></ha-circular-progress>
|
<paper-spinner active></paper-spinner>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template is="dom-if" if="[[!_loading]]">
|
<template is="dom-if" if="[[!_loading]]">
|
||||||
|
@@ -60,6 +60,12 @@ documentContainer.innerHTML = `<custom-style>
|
|||||||
--paper-grey-200: #eeeeee; /* for ha-date-picker-style */
|
--paper-grey-200: #eeeeee; /* for ha-date-picker-style */
|
||||||
--paper-grey-500: #9e9e9e; /* --label-badge-grey */
|
--paper-grey-500: #9e9e9e; /* --label-badge-grey */
|
||||||
|
|
||||||
|
/* for paper-spinner */
|
||||||
|
--google-red-500: #db4437;
|
||||||
|
--google-blue-500: #4285f4;
|
||||||
|
--google-green-500: #0f9d58;
|
||||||
|
--google-yellow-500: #f4b400;
|
||||||
|
|
||||||
/* for paper-slider */
|
/* for paper-slider */
|
||||||
--paper-green-400: #66bb6a;
|
--paper-green-400: #66bb6a;
|
||||||
--paper-blue-400: #42a5f5;
|
--paper-blue-400: #42a5f5;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import { css } from "lit-element";
|
import { css } from "lit-element";
|
||||||
|
|
||||||
export const derivedStyles = {
|
export const derivedStyles = {
|
||||||
|
"paper-spinner-color": "var(--primary-color)",
|
||||||
"error-state-color": "var(--error-color)",
|
"error-state-color": "var(--error-color)",
|
||||||
"state-icon-unavailable-color": "var(--disabled-text-color)",
|
"state-icon-unavailable-color": "var(--disabled-text-color)",
|
||||||
"sidebar-text-color": "var(--primary-text-color)",
|
"sidebar-text-color": "var(--primary-text-color)",
|
||||||
|
@@ -12,6 +12,7 @@ import SidebarMixin from "./sidebar-mixin";
|
|||||||
import ThemesMixin from "./themes-mixin";
|
import ThemesMixin from "./themes-mixin";
|
||||||
import TranslationsMixin from "./translations-mixin";
|
import TranslationsMixin from "./translations-mixin";
|
||||||
import { urlSyncMixin } from "./url-sync-mixin";
|
import { urlSyncMixin } from "./url-sync-mixin";
|
||||||
|
import { suspendMixin } from "./suspend-mixin";
|
||||||
|
|
||||||
const ext = <T extends Constructor>(baseClass: T, mixins): T =>
|
const ext = <T extends Constructor>(baseClass: T, mixins): T =>
|
||||||
mixins.reduceRight((base, mixin) => mixin(base), baseClass);
|
mixins.reduceRight((base, mixin) => mixin(base), baseClass);
|
||||||
@@ -24,6 +25,7 @@ export class HassElement extends ext(HassBaseEl, [
|
|||||||
SidebarMixin,
|
SidebarMixin,
|
||||||
DisconnectToastMixin,
|
DisconnectToastMixin,
|
||||||
connectionMixin,
|
connectionMixin,
|
||||||
|
suspendMixin,
|
||||||
NotificationMixin,
|
NotificationMixin,
|
||||||
dialogManagerMixin,
|
dialogManagerMixin,
|
||||||
urlSyncMixin,
|
urlSyncMixin,
|
||||||
|
48
src/state/suspend-mixin.ts
Normal file
48
src/state/suspend-mixin.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { Constructor } from "../types";
|
||||||
|
import { HassBaseEl } from "./hass-base-mixin";
|
||||||
|
|
||||||
|
export const suspendMixin = <T extends Constructor<HassBaseEl>>(
|
||||||
|
superClass: T
|
||||||
|
) =>
|
||||||
|
class extends superClass {
|
||||||
|
private __hiddenTimeout?: number;
|
||||||
|
|
||||||
|
private __visiblePromiseResolve?: () => void;
|
||||||
|
|
||||||
|
protected hassConnected() {
|
||||||
|
super.hassConnected();
|
||||||
|
|
||||||
|
document.addEventListener(
|
||||||
|
"visibilitychange",
|
||||||
|
() => this.__handleVisibilityChange(),
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private __handleVisibilityChange() {
|
||||||
|
if (document.hidden) {
|
||||||
|
// If the document is hidden, we will prevent reconnects until we are visible again
|
||||||
|
this.hass!.connection.suspendReconnectUntil(
|
||||||
|
new Promise((resolve) => {
|
||||||
|
this.__visiblePromiseResolve = resolve;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
// We close the connection to Home Assistant after being hidden for 5 minutes
|
||||||
|
this.__hiddenTimeout = window.setTimeout(() => {
|
||||||
|
this.__hiddenTimeout = undefined;
|
||||||
|
this.hass!.connection.suspend();
|
||||||
|
}, 300000);
|
||||||
|
} else {
|
||||||
|
// Clear timer to close the connection
|
||||||
|
if (this.__hiddenTimeout) {
|
||||||
|
clearTimeout(this.__hiddenTimeout);
|
||||||
|
this.__hiddenTimeout = undefined;
|
||||||
|
}
|
||||||
|
// Unsuspend the reconnect
|
||||||
|
if (this.__visiblePromiseResolve) {
|
||||||
|
this.__visiblePromiseResolve();
|
||||||
|
this.__visiblePromiseResolve = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
@@ -44,19 +44,6 @@
|
|||||||
"idle": "Idle",
|
"idle": "Idle",
|
||||||
"fan": "Fan"
|
"fan": "Fan"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"humidifier": {
|
|
||||||
"mode": {
|
|
||||||
"normal": "Normal",
|
|
||||||
"eco": "Eco",
|
|
||||||
"away": "Away",
|
|
||||||
"boost": "Boost",
|
|
||||||
"comfort": "Comfort",
|
|
||||||
"home": "Home",
|
|
||||||
"sleep": "Sleep",
|
|
||||||
"auto": "Auto",
|
|
||||||
"baby": "Baby"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"state_badge": {
|
"state_badge": {
|
||||||
@@ -159,12 +146,6 @@
|
|||||||
"forward": "Forward",
|
"forward": "Forward",
|
||||||
"reverse": "Reverse"
|
"reverse": "Reverse"
|
||||||
},
|
},
|
||||||
"humidifier": {
|
|
||||||
"humidity": "Target humidity",
|
|
||||||
"mode": "Mode",
|
|
||||||
"target_humidity_entity": "{name} target humidity",
|
|
||||||
"on_entity": "{name} on"
|
|
||||||
},
|
|
||||||
"light": {
|
"light": {
|
||||||
"brightness": "Brightness",
|
"brightness": "Brightness",
|
||||||
"color_temperature": "Color temperature",
|
"color_temperature": "Color temperature",
|
||||||
@@ -1954,10 +1935,6 @@
|
|||||||
"name": "Horizontal Stack",
|
"name": "Horizontal Stack",
|
||||||
"description": "The Horizontal Stack card allows you to stack together multiple cards, so they always sit next to each other in the space of one column."
|
"description": "The Horizontal Stack card allows you to stack together multiple cards, so they always sit next to each other in the space of one column."
|
||||||
},
|
},
|
||||||
"humidifier": {
|
|
||||||
"name": "Humidifier",
|
|
||||||
"description": "The Humidifier card gives control of your humidifier entity. Allowing you to change the humidity and mode of the entity."
|
|
||||||
},
|
|
||||||
"iframe": {
|
"iframe": {
|
||||||
"name": "Webpage",
|
"name": "Webpage",
|
||||||
"description": "The Webpage card allows you to embed your favorite webpage right into Home Assistant."
|
"description": "The Webpage card allows you to embed your favorite webpage right into Home Assistant."
|
||||||
|
@@ -37,7 +37,6 @@ hassAttributeUtil.DOMAIN_DEVICE_CLASS = {
|
|||||||
"shutter",
|
"shutter",
|
||||||
"window",
|
"window",
|
||||||
],
|
],
|
||||||
humidifier: ["dehumidifier", "humidifier"],
|
|
||||||
sensor: [
|
sensor: [
|
||||||
"battery",
|
"battery",
|
||||||
"humidity",
|
"humidity",
|
||||||
@@ -90,7 +89,7 @@ hassAttributeUtil.LOGIC_STATE_ATTRIBUTES = hassAttributeUtil.LOGIC_STATE_ATTRIBU
|
|||||||
type: "array",
|
type: "array",
|
||||||
options: hassAttributeUtil.DOMAIN_DEVICE_CLASS,
|
options: hassAttributeUtil.DOMAIN_DEVICE_CLASS,
|
||||||
description: "Device class",
|
description: "Device class",
|
||||||
domains: ["binary_sensor", "cover", "humidifier", "sensor", "switch"],
|
domains: ["binary_sensor", "cover", "sensor", "switch"],
|
||||||
},
|
},
|
||||||
hidden: { type: "boolean", description: "Hide from UI" },
|
hidden: { type: "boolean", description: "Hide from UI" },
|
||||||
assumed_state: {
|
assumed_state: {
|
||||||
@@ -101,7 +100,6 @@ hassAttributeUtil.LOGIC_STATE_ATTRIBUTES = hassAttributeUtil.LOGIC_STATE_ATTRIBU
|
|||||||
"cover",
|
"cover",
|
||||||
"climate",
|
"climate",
|
||||||
"fan",
|
"fan",
|
||||||
"humidifier",
|
|
||||||
"group",
|
"group",
|
||||||
"water_heater",
|
"water_heater",
|
||||||
],
|
],
|
||||||
|
@@ -506,11 +506,6 @@
|
|||||||
"clear": "Esborra",
|
"clear": "Esborra",
|
||||||
"show_areas": "Mostra àrees"
|
"show_areas": "Mostra àrees"
|
||||||
},
|
},
|
||||||
"date-range-picker": {
|
|
||||||
"end_date": "Data final",
|
|
||||||
"select": "Selecciona",
|
|
||||||
"start_date": "Data inici"
|
|
||||||
},
|
|
||||||
"device-picker": {
|
"device-picker": {
|
||||||
"clear": "Esborra",
|
"clear": "Esborra",
|
||||||
"device": "Dispositiu",
|
"device": "Dispositiu",
|
||||||
@@ -700,7 +695,6 @@
|
|||||||
"zha_device_info": {
|
"zha_device_info": {
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"add": "Afegeix dispositius a través d'aquest dispositiu",
|
"add": "Afegeix dispositius a través d'aquest dispositiu",
|
||||||
"clusters": "Gestiona clústers",
|
|
||||||
"reconfigure": "Reconfigurar dispositiu",
|
"reconfigure": "Reconfigurar dispositiu",
|
||||||
"remove": "Eliminar dispositiu",
|
"remove": "Eliminar dispositiu",
|
||||||
"zigbee_information": "Signatura Zigbee del dispositiu"
|
"zigbee_information": "Signatura Zigbee del dispositiu"
|
||||||
@@ -1564,7 +1558,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mqtt": {
|
"mqtt": {
|
||||||
"button": "Configura",
|
|
||||||
"description_listen": "Escolta d'un tòpic",
|
"description_listen": "Escolta d'un tòpic",
|
||||||
"description_publish": "Publicació d'un paquet",
|
"description_publish": "Publicació d'un paquet",
|
||||||
"listening_to": "Escoltant a",
|
"listening_to": "Escoltant a",
|
||||||
@@ -2042,23 +2035,11 @@
|
|||||||
},
|
},
|
||||||
"history": {
|
"history": {
|
||||||
"period": "Període",
|
"period": "Període",
|
||||||
"ranges": {
|
|
||||||
"last_week": "La setmana passada",
|
|
||||||
"this_week": "Aquesta setmana",
|
|
||||||
"today": "Avui",
|
|
||||||
"yesterday": "Ahir"
|
|
||||||
},
|
|
||||||
"showing_entries": "Mostrant entrades de"
|
"showing_entries": "Mostrant entrades de"
|
||||||
},
|
},
|
||||||
"logbook": {
|
"logbook": {
|
||||||
"entries_not_found": "No s'han trobat entrades al registre.",
|
"entries_not_found": "No s'han trobat entrades al registre.",
|
||||||
"period": "Període",
|
"period": "Període",
|
||||||
"ranges": {
|
|
||||||
"last_week": "La setmana passada",
|
|
||||||
"this_week": "Aquesta setmana",
|
|
||||||
"today": "Avui",
|
|
||||||
"yesterday": "Ahir"
|
|
||||||
},
|
|
||||||
"showing_entries": "Mostrant entrades de"
|
"showing_entries": "Mostrant entrades de"
|
||||||
},
|
},
|
||||||
"lovelace": {
|
"lovelace": {
|
||||||
|
@@ -506,11 +506,6 @@
|
|||||||
"clear": "Ryd",
|
"clear": "Ryd",
|
||||||
"show_areas": "Vis områder"
|
"show_areas": "Vis områder"
|
||||||
},
|
},
|
||||||
"date-range-picker": {
|
|
||||||
"end_date": "Slutdato",
|
|
||||||
"select": "Vælg",
|
|
||||||
"start_date": "Startdato"
|
|
||||||
},
|
|
||||||
"device-picker": {
|
"device-picker": {
|
||||||
"clear": "Ryd",
|
"clear": "Ryd",
|
||||||
"device": "Enhed",
|
"device": "Enhed",
|
||||||
@@ -700,7 +695,6 @@
|
|||||||
"zha_device_info": {
|
"zha_device_info": {
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"add": "Tilføj enheder",
|
"add": "Tilføj enheder",
|
||||||
"clusters": "Administrer klynger",
|
|
||||||
"reconfigure": "Genkonfigurer enhed",
|
"reconfigure": "Genkonfigurer enhed",
|
||||||
"remove": "Fjern enhed",
|
"remove": "Fjern enhed",
|
||||||
"zigbee_information": "Zigbee-oplysninger"
|
"zigbee_information": "Zigbee-oplysninger"
|
||||||
@@ -1564,7 +1558,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mqtt": {
|
"mqtt": {
|
||||||
"button": "Konfigurer",
|
|
||||||
"description_listen": "Lyt til et emne",
|
"description_listen": "Lyt til et emne",
|
||||||
"description_publish": "Udsend en pakke",
|
"description_publish": "Udsend en pakke",
|
||||||
"listening_to": "Lytter til",
|
"listening_to": "Lytter til",
|
||||||
@@ -2015,23 +2008,11 @@
|
|||||||
},
|
},
|
||||||
"history": {
|
"history": {
|
||||||
"period": "Periode",
|
"period": "Periode",
|
||||||
"ranges": {
|
|
||||||
"last_week": "Sidste uge",
|
|
||||||
"this_week": "Denne uge",
|
|
||||||
"today": "I dag",
|
|
||||||
"yesterday": "I går"
|
|
||||||
},
|
|
||||||
"showing_entries": "Viser poster for"
|
"showing_entries": "Viser poster for"
|
||||||
},
|
},
|
||||||
"logbook": {
|
"logbook": {
|
||||||
"entries_not_found": "Der blev ikke fundet nogen logbogsposter.",
|
"entries_not_found": "Der blev ikke fundet nogen logbogsposter.",
|
||||||
"period": "Periode",
|
"period": "Periode",
|
||||||
"ranges": {
|
|
||||||
"last_week": "Sidste uge",
|
|
||||||
"this_week": "Denne uge",
|
|
||||||
"today": "I dag",
|
|
||||||
"yesterday": "I går"
|
|
||||||
},
|
|
||||||
"showing_entries": "Viser poster for"
|
"showing_entries": "Viser poster for"
|
||||||
},
|
},
|
||||||
"lovelace": {
|
"lovelace": {
|
||||||
|
@@ -506,11 +506,6 @@
|
|||||||
"clear": "Limpiar",
|
"clear": "Limpiar",
|
||||||
"show_areas": "Mostrar áreas"
|
"show_areas": "Mostrar áreas"
|
||||||
},
|
},
|
||||||
"date-range-picker": {
|
|
||||||
"end_date": "Fecha de finalización",
|
|
||||||
"select": "Seleccione",
|
|
||||||
"start_date": "Fecha de inicio"
|
|
||||||
},
|
|
||||||
"device-picker": {
|
"device-picker": {
|
||||||
"clear": "Limpiar",
|
"clear": "Limpiar",
|
||||||
"device": "Dispositivo",
|
"device": "Dispositivo",
|
||||||
@@ -700,7 +695,6 @@
|
|||||||
"zha_device_info": {
|
"zha_device_info": {
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"add": "Añadir dispositivos a través de este dispositivo",
|
"add": "Añadir dispositivos a través de este dispositivo",
|
||||||
"clusters": "Administrar clústeres",
|
|
||||||
"reconfigure": "Reconfigurar dispositivo",
|
"reconfigure": "Reconfigurar dispositivo",
|
||||||
"remove": "Eliminar dispositivos",
|
"remove": "Eliminar dispositivos",
|
||||||
"zigbee_information": "Firma del dispositivo Zigbee"
|
"zigbee_information": "Firma del dispositivo Zigbee"
|
||||||
@@ -1564,7 +1558,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mqtt": {
|
"mqtt": {
|
||||||
"button": "Configurar",
|
|
||||||
"description_listen": "Escuchar un tema",
|
"description_listen": "Escuchar un tema",
|
||||||
"description_publish": "Publicar un paquete",
|
"description_publish": "Publicar un paquete",
|
||||||
"listening_to": "Escuchando",
|
"listening_to": "Escuchando",
|
||||||
@@ -2042,23 +2035,11 @@
|
|||||||
},
|
},
|
||||||
"history": {
|
"history": {
|
||||||
"period": "Periodo",
|
"period": "Periodo",
|
||||||
"ranges": {
|
|
||||||
"last_week": "La semana pasada",
|
|
||||||
"this_week": "Esta semana",
|
|
||||||
"today": "Hoy",
|
|
||||||
"yesterday": "Ayer"
|
|
||||||
},
|
|
||||||
"showing_entries": "Mostrando entradas del"
|
"showing_entries": "Mostrando entradas del"
|
||||||
},
|
},
|
||||||
"logbook": {
|
"logbook": {
|
||||||
"entries_not_found": "No se han encontrado entradas en el registro.",
|
"entries_not_found": "No se han encontrado entradas en el registro.",
|
||||||
"period": "Periodo",
|
"period": "Periodo",
|
||||||
"ranges": {
|
|
||||||
"last_week": "La semana pasada",
|
|
||||||
"this_week": "Esta semana",
|
|
||||||
"today": "Hoy",
|
|
||||||
"yesterday": "Ayer"
|
|
||||||
},
|
|
||||||
"showing_entries": "Mostrando entradas del"
|
"showing_entries": "Mostrando entradas del"
|
||||||
},
|
},
|
||||||
"lovelace": {
|
"lovelace": {
|
||||||
|
@@ -506,11 +506,6 @@
|
|||||||
"clear": "Effacer",
|
"clear": "Effacer",
|
||||||
"show_areas": "Afficher les pièces"
|
"show_areas": "Afficher les pièces"
|
||||||
},
|
},
|
||||||
"date-range-picker": {
|
|
||||||
"end_date": "Date de fin",
|
|
||||||
"select": "Sélectionner",
|
|
||||||
"start_date": "Date de début"
|
|
||||||
},
|
|
||||||
"device-picker": {
|
"device-picker": {
|
||||||
"clear": "Effacer",
|
"clear": "Effacer",
|
||||||
"device": "Appareil",
|
"device": "Appareil",
|
||||||
@@ -700,7 +695,6 @@
|
|||||||
"zha_device_info": {
|
"zha_device_info": {
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"add": "Ajouter des appareils",
|
"add": "Ajouter des appareils",
|
||||||
"clusters": "Gérer les clusters",
|
|
||||||
"reconfigure": "Reconfigurer l'appareil",
|
"reconfigure": "Reconfigurer l'appareil",
|
||||||
"remove": "Supprimer l'appareil",
|
"remove": "Supprimer l'appareil",
|
||||||
"zigbee_information": "Informations Zigbee"
|
"zigbee_information": "Informations Zigbee"
|
||||||
@@ -1564,7 +1558,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mqtt": {
|
"mqtt": {
|
||||||
"button": "Configurer",
|
|
||||||
"description_listen": "Écouter un sujet",
|
"description_listen": "Écouter un sujet",
|
||||||
"description_publish": "Publier un paquet",
|
"description_publish": "Publier un paquet",
|
||||||
"listening_to": "Écouter",
|
"listening_to": "Écouter",
|
||||||
@@ -2042,23 +2035,11 @@
|
|||||||
},
|
},
|
||||||
"history": {
|
"history": {
|
||||||
"period": "Période",
|
"period": "Période",
|
||||||
"ranges": {
|
|
||||||
"last_week": "La semaine dernière",
|
|
||||||
"this_week": "Cette semaine",
|
|
||||||
"today": "Aujourd'hui",
|
|
||||||
"yesterday": "Hier"
|
|
||||||
},
|
|
||||||
"showing_entries": "Afficher les entrées pour"
|
"showing_entries": "Afficher les entrées pour"
|
||||||
},
|
},
|
||||||
"logbook": {
|
"logbook": {
|
||||||
"entries_not_found": "Aucune entrée trouvée dans le journal.",
|
"entries_not_found": "Aucune entrée trouvée dans le journal.",
|
||||||
"period": "Période",
|
"period": "Période",
|
||||||
"ranges": {
|
|
||||||
"last_week": "La semaine dernière",
|
|
||||||
"this_week": "Cette semaine",
|
|
||||||
"today": "Aujourd'hui",
|
|
||||||
"yesterday": "Hier"
|
|
||||||
},
|
|
||||||
"showing_entries": "Afficher les entrées pour le"
|
"showing_entries": "Afficher les entrées pour le"
|
||||||
},
|
},
|
||||||
"lovelace": {
|
"lovelace": {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user