mirror of
https://github.com/home-assistant/frontend.git
synced 2026-11-23 21:28:49 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d52b301d3 | ||
|
|
b2bec6001a |
No files matched your search
+1
-1
@@ -222,7 +222,7 @@
|
||||
"webpackbar": "7.0.0",
|
||||
"workbox-build": "7.4.1"
|
||||
},
|
||||
"packageManager": "[email protected]2.0",
|
||||
"packageManager": "[email protected]1.0",
|
||||
"volta": {
|
||||
"node": "24.22.3"
|
||||
}
|
||||
|
||||
Generated
+65
-65
@@ -7,162 +7,162 @@ importers:
|
||||
configDependencies: {}
|
||||
packageManagerDependencies:
|
||||
pnpm:
|
||||
specifier: 12.22.0
|
||||
version: 12.22.0
|
||||
specifier: 12.21.0
|
||||
version: 12.21.0
|
||||
|
||||
packages:
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-n0kwk3uOtWGaSMJWUuxG8fLefRonw8jR27dhGzMcDz79Um37QKPLEGZAZF37iASbb2yBBQFl4hue6/SfQnmIdA==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-iaWidxR5B9NUBpwMznCQu1yUpKB6BjTY5BYX2lORj76VsfINdj8Z8XWSzSNrGI8qlxa28Jzdp5fiaspzOaJZlA==}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-1HERYEdvJEjU5p/lyI8g3YNEVdvVz6+omaqI1pKotZB9w92BlSXr0xTqur8X/8GAiE4B/pwZi8+eAi4v+KQVHg==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-35e5v3wlwjIYxDywq+R6/z8CE4gLOEgRxt18yqz1tMRLmx2mnW+CFJI2Q8+srTNjn7gykXUC0x1k195JNikC5A==}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-CU0m1tFFVW2QD2PDVTsdejYGoPzhMq04l/MnwhpCuM2iBXkMXqV52kH24U5A2SYULV4Y/TTYsKL5InKZblVNvw==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-F5OyMX/6zLSowpTZEQRojbCmPS1Pq+fyRaIinslsIe6Glh3qbyQ52u+Fe0eEzSaRuIbWZkXmAAXSWh6Q5Wrlgg==}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-XjVoliuAZjcyQJVymR+n3xmkw3SBME3Sg7wjKBTNbOaTGe3RLIkXt8D9YXOoSnET8gyhQrY8fwThFT+Ki6IVNw==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-EzpvcsaE6hrrgYeEiAFYd2rSgFybYyxXhkAY7K3y6Hg3loVfcyJ81hHczpFzi8lW5RXtUlFECRPZ8ZAMRFQYYg==}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-BefdhvM+nrLXHCRVFmNv5yp4Zhwz29nEP+UPhsvGRRp4YRzgmyxT9r0lVts3Lg0FzcKOtPbM3o0Hyb2y0JF3yw==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-wNjuEnmdLks4aayPu/QZWQ5tQM9Jn+odUp/vwQM8BXRYoulkTZhtZTHoD60N6mUdLWef1hgUeUh8llNGEUsimw==}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-72fwiRonMxFAY4Fb611eTaR+8bYwH91SnWCg3aODjhigCMURFe5Pom+TtYM/GMrme2yirGkHbpzU2u0lMMCwTQ==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-Ceit9zn4g5ZqCJtx1fV8eJE7p8aeXMrGZ+Dc01vRqZLIUNgNeI+Ur0ruyqxtsnJx6rGADyXzohumxPLHjaJ5AQ==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-1MZ3GfFCFckquAJP6WZ985Lrd5MP5YNA7vPZH79W+1QVzwl55fVMdsAOczdGnFeU4jqMwERnk129/1g9zYxhDw==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-4Oj/iF2TDCe2lcH0n4TupPR5sSdrNLclJB6xBElLMPCUOAvBhdf2rRlSaO5M4erJ6g4Fyy7YTXTpcmfFsKyxEA==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-JOmNBnncDB+9pa8ddtIp9qrLrKwvgzV92xWEFAXSBrDcPIIAdD7imtk3kZnoiApdRzPbQHHj6JJKKVmOUXN0Bw==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-s2o7rdSDeUTBFsNqxptpZXlTgT6cojmMVUOvTQvFNSv6Easian02ha4tR32fwwD97Au4YzIIjMCwywCF4D82Sw==}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-4oJ2VAuzpEnySBxZ9uz9dwIZYqOcgJ7FWIFdPDf9QbkYo8NbskZ2ySgHwlDVnvQYGhTM45kFRDwjfhKYZJJ9PQ==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-EYv3GzxeBTITCuM3yGHHbpRFpUvyulkXpQ6LsjKAQNL3iaba1E6h9iDmlouLb3Io4AMMsfdk0/uG6poQ41uewA==}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-wLbmg1e+9qAUbqZ29/BUvAQwiZtvgzKg3kjDIN4tkxrCATnneM2G0agFpD9yLHD3FT5J8bUB8RWSur5vqm4Vnw==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-8VXGNGVNEfs7pL9GTZOzFxjFEnMt4WL3rLOADR5/kPQ7ROTV9GfpVI2DPO/zArXFSkvfc9Zad/WypHLbvzoaTQ==}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-ODMJgTVHvs/WOqQKE9Am5u7RztsNjXZpkn73z9z4SsU7Dtrr/3IQkjvsF1MGM9hbhMdGwl2BHAW91eCCipIsHQ==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-MnC5vpIXYubhDZCgCwlfJMg7Cg6HupN2IuouT9gD/tUmOfVdQYqeyYccWbthyo/Jeto8de1oQlxeRN1+1Hl2DQ==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-iBAZAYCYoow6g0aObKmprKkIBGO72mK4KFfqIrY7jIdHRkAbN67tcN0zgaPE39UAEdMcrkLhLwEml+VMxf8h8Q==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-8eufCjHXspKbNS/kh8q4Q0gqJoOuvC4Q5pgos6XS8By/nAMtP+jf8F1Cw9er840kfAX+PJ/ts+A9qnLE91rvXQ==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-5y9seaGcEL2OH5p9PG1cZRnSQKENvzK8hTsTjkFxUxXM84OCDvSlaSLr4ABrjrxWKlo4k8bjnmW7NEwznlowGA==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-eyh1M8hQZCkLWxuva7S/fc1SbFbgqg0/5di0dgWmyiuc2Io3dbWVihDun8X+XM8zsR5uhIDvvZpbS9aZQbCovg==}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-eMJWsyECSWxhGDQwPokhES8dJX0dsu7E0tUfhxAaUnFxX7oBKKNS7kBY9yY75sNq4CmMNLjhOtBwrVjd3bQ1Hg==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-7xTxxUXo/grRLivSeIl6B21gnsz7ooe5EMPcJmQqwxc8WLJVReN8MzrlHru8bqXfVr4X3+6ZGZscntKenlCBqQ==}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
resolution: {integrity: sha512-d0D0GIiDkdiUiENlz3sMOR3arSsApaXtBZl2+rDwbwtQJ5IIBopf4KVTSZDPr09yl2NUVglCS5roveGKpYCWOg==}
|
||||
'@pnpm/[email protected]1.0':
|
||||
resolution: {integrity: sha512-9TpkJemVApxJ1Z1w0ZFGN+AuSx4nJOqXSJUqMqDvaXTYwGOzvBiiWdFP9GN0ketiWCQS1Q0/pza2E7I3pP0OBQ==}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
[email protected]2.0:
|
||||
resolution: {integrity: sha512-iUlAo9mlffpv03OZD7TkHgnC8tdtmC7R11J105Jn+Yj7Ti1AkAy+mSHGjZfGeqGhCW0nZjPbJI97NJJ6yd23pA==}
|
||||
[email protected]1.0:
|
||||
resolution: {integrity: sha512-Zv2CeO4ok1zpUXktNDZ/869cQyonVkRYIwKVM4NbjaUpu+C+UTCv1W7QcT+4eJ5Hutgtk71a4v5UsVVi1idu8A==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
|
||||
snapshots:
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
'@pnpm/[email protected]2.0':
|
||||
'@pnpm/[email protected]1.0':
|
||||
optional: true
|
||||
|
||||
[email protected]2.0:
|
||||
[email protected]1.0:
|
||||
optionalDependencies:
|
||||
'@pnpm/exe.android-arm64': 12.22.0
|
||||
'@pnpm/exe.android-x64': 12.22.0
|
||||
'@pnpm/exe.darwin-arm64': 12.22.0
|
||||
'@pnpm/exe.darwin-x64': 12.22.0
|
||||
'@pnpm/exe.freebsd-x64': 12.22.0
|
||||
'@pnpm/exe.linux-arm64': 12.22.0
|
||||
'@pnpm/exe.linux-arm64-musl': 12.22.0
|
||||
'@pnpm/exe.linux-ppc64': 12.22.0
|
||||
'@pnpm/exe.linux-riscv64': 12.22.0
|
||||
'@pnpm/exe.linux-s390x': 12.22.0
|
||||
'@pnpm/exe.linux-x64': 12.22.0
|
||||
'@pnpm/exe.linux-x64-musl': 12.22.0
|
||||
'@pnpm/exe.netbsd-x64': 12.22.0
|
||||
'@pnpm/exe.win32-arm64': 12.22.0
|
||||
'@pnpm/exe.win32-x64': 12.22.0
|
||||
'@pnpm/exe.android-arm64': 12.21.0
|
||||
'@pnpm/exe.android-x64': 12.21.0
|
||||
'@pnpm/exe.darwin-arm64': 12.21.0
|
||||
'@pnpm/exe.darwin-x64': 12.21.0
|
||||
'@pnpm/exe.freebsd-x64': 12.21.0
|
||||
'@pnpm/exe.linux-arm64': 12.21.0
|
||||
'@pnpm/exe.linux-arm64-musl': 12.21.0
|
||||
'@pnpm/exe.linux-ppc64': 12.21.0
|
||||
'@pnpm/exe.linux-riscv64': 12.21.0
|
||||
'@pnpm/exe.linux-s390x': 12.21.0
|
||||
'@pnpm/exe.linux-x64': 12.21.0
|
||||
'@pnpm/exe.linux-x64-musl': 12.21.0
|
||||
'@pnpm/exe.netbsd-x64': 12.21.0
|
||||
'@pnpm/exe.win32-arm64': 12.21.0
|
||||
'@pnpm/exe.win32-x64': 12.21.0
|
||||
|
||||
---
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
@@ -2372,21 +2372,30 @@ export class HaChartBase extends MobileAwareMixin(LitElement) {
|
||||
margin-inline-start: auto;
|
||||
flex-shrink: 0;
|
||||
pointer-events: auto;
|
||||
/* Inherited, so buttons nested in slots or dropdowns get the frame too */
|
||||
--ha-icon-button-background: var(--card-background-color);
|
||||
--ha-icon-button-border: 1px solid var(--divider-color);
|
||||
--ha-icon-button-border-radius: var(--ha-border-radius-sm);
|
||||
--ha-icon-button-size: 32px;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
.top-controls.small {
|
||||
top: 0;
|
||||
}
|
||||
.chart-controls.small {
|
||||
flex-direction: row;
|
||||
}
|
||||
.chart-controls ha-icon-button,
|
||||
.chart-controls ::slotted(ha-icon-button) {
|
||||
background: var(--card-background-color);
|
||||
border-radius: var(--ha-border-radius-sm);
|
||||
--ha-icon-button-size: 32px;
|
||||
color: var(--primary-color);
|
||||
border: 1px solid var(--divider-color);
|
||||
}
|
||||
.chart-controls.small ha-icon-button,
|
||||
.chart-controls.small ::slotted(ha-icon-button) {
|
||||
--ha-icon-button-size: 22px;
|
||||
--mdc-icon-size: 16px;
|
||||
}
|
||||
.chart-controls ha-icon-button.inactive,
|
||||
.chart-controls ::slotted(ha-icon-button.inactive) {
|
||||
color: var(--state-inactive-color);
|
||||
}
|
||||
.chart-legend {
|
||||
max-height: 60%;
|
||||
overflow-y: auto;
|
||||
|
||||
@@ -217,7 +217,6 @@ export class HaNetworkGraph extends LitElement {
|
||||
<ha-icon-button
|
||||
slot="button"
|
||||
class=${this._physicsEnabled ? "active" : "inactive"}
|
||||
.ariaPressed=${this._physicsEnabled ? "true" : "false"}
|
||||
.path=${mdiGoogleCirclesGroup}
|
||||
@click=${this._togglePhysics}
|
||||
label=${this._localize("ui.panel.config.common.graph.toggle_physics")}
|
||||
@@ -225,7 +224,6 @@ export class HaNetworkGraph extends LitElement {
|
||||
<ha-icon-button
|
||||
slot="button"
|
||||
class=${this._showLabels ? "active" : "inactive"}
|
||||
.ariaPressed=${this._showLabels ? "true" : "false"}
|
||||
.path=${mdiFormatTextVariant}
|
||||
@click=${this._toggleLabels}
|
||||
label=${this._localize("ui.panel.config.common.graph.toggle_labels")}
|
||||
@@ -848,10 +846,6 @@ export class HaNetworkGraph extends LitElement {
|
||||
::slotted(ha-icon-button) {
|
||||
margin-inline-end: var(--ha-space-3);
|
||||
}
|
||||
ha-icon-button.inactive,
|
||||
::slotted(ha-icon-button.inactive) {
|
||||
color: var(--state-inactive-color);
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import type { ContextType } from "@lit/context";
|
||||
import { mdiArrowBottomLeft, mdiArrowTopRight, mdiStop } from "@mdi/js";
|
||||
import {
|
||||
mdiStop,
|
||||
mdiUnfoldLessHorizontal,
|
||||
mdiUnfoldMoreHorizontal,
|
||||
} from "@mdi/js";
|
||||
import { css, html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { classMap } from "lit/directives/class-map";
|
||||
@@ -39,7 +43,7 @@ class HaCoverTiltControls extends LitElement {
|
||||
),
|
||||
})}
|
||||
.label=${this._localize("ui.card.cover.open_tilt_cover")}
|
||||
.path=${mdiArrowTopRight}
|
||||
.path=${mdiUnfoldMoreHorizontal}
|
||||
@click=${this._onOpenTiltTap}
|
||||
.disabled=${!canOpenTilt(this.stateObj)}
|
||||
></ha-icon-button>
|
||||
@@ -63,7 +67,7 @@ class HaCoverTiltControls extends LitElement {
|
||||
),
|
||||
})}
|
||||
.label=${this._localize("ui.card.cover.close_tilt_cover")}
|
||||
.path=${mdiArrowBottomLeft}
|
||||
.path=${mdiUnfoldLessHorizontal}
|
||||
@click=${this._onCloseTiltTap}
|
||||
.disabled=${!canCloseTilt(this.stateObj)}
|
||||
></ha-icon-button>`;
|
||||
|
||||
@@ -22,9 +22,6 @@ export class HaIconButton extends LitElement {
|
||||
@property({ type: String, attribute: "aria-haspopup" })
|
||||
ariaHasPopup!: "false" | "true" | "menu" | "listbox" | "tree" | "grid";
|
||||
|
||||
@property({ attribute: false })
|
||||
ariaPressed!: "false" | "true" | "mixed";
|
||||
|
||||
@property({ attribute: "hide-title", type: Boolean }) hideTitle = false;
|
||||
|
||||
@property({ type: Boolean, reflect: true }) selected = false;
|
||||
@@ -50,7 +47,6 @@ export class HaIconButton extends LitElement {
|
||||
.accessibleLabel=${this.label ?? ""}
|
||||
.title=${this.hideTitle ? "" : (this.label ?? "")}
|
||||
aria-haspopup=${ifDefined(this.ariaHasPopup)}
|
||||
.ariaPressed=${this.ariaPressed ?? null}
|
||||
.disabled=${this.disabled}
|
||||
.iconTag=${this.path ? "ha-svg-icon" : "span"}
|
||||
.href=${this.href}
|
||||
@@ -75,9 +71,6 @@ export class HaIconButton extends LitElement {
|
||||
display: inline-block;
|
||||
outline: none;
|
||||
--ha-button-height: var(--ha-icon-button-size, 48px);
|
||||
background: var(--ha-icon-button-background);
|
||||
border: var(--ha-icon-button-border);
|
||||
border-radius: var(--ha-icon-button-border-radius);
|
||||
}
|
||||
ha-button {
|
||||
position: relative;
|
||||
@@ -89,14 +82,13 @@ export class HaIconButton extends LitElement {
|
||||
--wa-color-on-normal: currentColor;
|
||||
--wa-color-fill-quiet: transparent;
|
||||
--ha-button-label-overflow: visible;
|
||||
--ha-button-border-radius: var(--ha-icon-button-border-radius, 50%);
|
||||
}
|
||||
ha-button::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
border-radius: var(--ha-icon-button-border-radius, 50%);
|
||||
border-radius: 50%;
|
||||
background-color: currentColor;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
|
||||
+28
-1
@@ -124,8 +124,32 @@ export function isFullyClosed(stateObj: CoverEntity) {
|
||||
return stateObj.state === "closed";
|
||||
}
|
||||
|
||||
export function coverOpenTiltPosition(stateObj: CoverEntity): number {
|
||||
return stateObj.attributes.open_tilt_position ?? 100;
|
||||
}
|
||||
|
||||
export function coverTiltAngle(stateObj: CoverEntity, tilt: number): number {
|
||||
const start = stateObj.attributes.tilt_start_angle;
|
||||
const end = stateObj.attributes.tilt_end_angle;
|
||||
if (start != null && end != null) {
|
||||
return start + ((end - start) * tilt) / 100;
|
||||
}
|
||||
const open = coverOpenTiltPosition(stateObj);
|
||||
if (tilt <= open) {
|
||||
return open === 0 ? 0 : (-90 * (open - tilt)) / open;
|
||||
}
|
||||
return (90 * (tilt - open)) / (100 - open);
|
||||
}
|
||||
|
||||
export function coverTiltOpenness(stateObj: CoverEntity, tilt: number) {
|
||||
return 100 * (1 - Math.min(1, Math.abs(coverTiltAngle(stateObj, tilt)) / 90));
|
||||
}
|
||||
|
||||
export function isFullyOpenTilt(stateObj: CoverEntity) {
|
||||
return stateObj.attributes.current_tilt_position === 100;
|
||||
return (
|
||||
stateObj.attributes.current_tilt_position ===
|
||||
coverOpenTiltPosition(stateObj)
|
||||
);
|
||||
}
|
||||
|
||||
export function isFullyClosedTilt(stateObj: CoverEntity) {
|
||||
@@ -199,6 +223,9 @@ export function canStopTilt(stateObj: CoverEntity): boolean {
|
||||
interface CoverEntityAttributes extends HassEntityAttributeBase {
|
||||
current_position?: number;
|
||||
current_tilt_position?: number;
|
||||
open_tilt_position?: number;
|
||||
tilt_start_angle?: number;
|
||||
tilt_end_angle?: number;
|
||||
supported_speeds?: string[];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { mdiArrowBottomLeft, mdiArrowTopRight, mdiStop } from "@mdi/js";
|
||||
import {
|
||||
mdiStop,
|
||||
mdiUnfoldLessHorizontal,
|
||||
mdiUnfoldMoreHorizontal,
|
||||
} from "@mdi/js";
|
||||
import { LitElement, css, html, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { consumeLocalize } from "../../../../common/decorators/consume-context-entry";
|
||||
@@ -65,7 +69,7 @@ const BUTTONS: Record<CoverControlMode, CoverButton[]> = {
|
||||
{
|
||||
action: "open",
|
||||
feature: CoverEntityFeature.OPEN_TILT,
|
||||
icon: () => mdiArrowTopRight,
|
||||
icon: () => mdiUnfoldMoreHorizontal,
|
||||
label: "ui.card.cover.open_tilt_cover",
|
||||
enabled: canOpenTilt,
|
||||
},
|
||||
@@ -79,7 +83,7 @@ const BUTTONS: Record<CoverControlMode, CoverButton[]> = {
|
||||
{
|
||||
action: "close",
|
||||
feature: CoverEntityFeature.CLOSE_TILT,
|
||||
icon: () => mdiArrowBottomLeft,
|
||||
icon: () => mdiUnfoldLessHorizontal,
|
||||
label: "ui.card.cover.close_tilt_cover",
|
||||
enabled: canCloseTilt,
|
||||
},
|
||||
|
||||
+11
-1
@@ -169,7 +169,6 @@ export class ZWaveJSNetworkVisualization extends SubscribeMixin(LitElement) {
|
||||
<ha-icon-button
|
||||
slot="button"
|
||||
class=${this._showNeighbors ? "active" : "inactive"}
|
||||
.ariaPressed=${this._showNeighbors ? "true" : "false"}
|
||||
.path=${mdiSpiderWeb}
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.config.zwave_js.visualization.toggle_neighbors"
|
||||
@@ -563,6 +562,17 @@ export class ZWaveJSNetworkVisualization extends SubscribeMixin(LitElement) {
|
||||
ha-input-search {
|
||||
flex: 1;
|
||||
}
|
||||
/* ha-chart-base can't style re-slotted buttons, so mirror its look */
|
||||
ha-icon-button[slot="button"] {
|
||||
background: var(--card-background-color);
|
||||
border-radius: var(--ha-border-radius-sm);
|
||||
--ha-icon-button-size: 32px;
|
||||
color: var(--primary-color);
|
||||
border: 1px solid var(--divider-color);
|
||||
}
|
||||
ha-icon-button[slot="button"].inactive {
|
||||
color: var(--state-inactive-color);
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import memoizeOne from "memoize-one";
|
||||
import { ensureArray } from "../../common/array/ensure-array";
|
||||
import { storage } from "../../common/decorators/storage";
|
||||
import type {
|
||||
HASSDomCurrentTargetEvent,
|
||||
HASSDomEvent,
|
||||
HASSDomTargetEvent,
|
||||
} from "../../common/dom/fire_event";
|
||||
@@ -123,8 +122,6 @@ class HaPanelHistory extends LitElement {
|
||||
// The zoom window shared by all charts, in percent of their x-axis
|
||||
@state() private _zoomRange: [number, number] = [0, 100];
|
||||
|
||||
@state() private _zoomBarHeld = false;
|
||||
|
||||
@state() private _filters: SourceFilters = {};
|
||||
|
||||
// Only one filter is expanded at a time, so that it can use the height
|
||||
@@ -205,8 +202,7 @@ class HaPanelHistory extends LitElement {
|
||||
!!this._mungedStateHistory &&
|
||||
(this._mungedStateHistory.line.length > 0 ||
|
||||
this._mungedStateHistory.timeline.length > 0);
|
||||
const hasCharts = !loading && hasTargets && hasResults;
|
||||
const showZoomBar = hasCharts && (this._isZoomed() || this._zoomBarHeld);
|
||||
const showZoomBar = !loading && hasTargets && hasResults;
|
||||
const sourcesLabel = sourceCount
|
||||
? this.hass.localize("ui.panel.history.sources_count", {
|
||||
count: entityIds.length,
|
||||
@@ -339,13 +335,8 @@ class HaPanelHistory extends LitElement {
|
||||
}
|
||||
</div>
|
||||
${
|
||||
hasCharts
|
||||
? html`<ha-card
|
||||
class=${classMap({
|
||||
"zoom-bar": true,
|
||||
"keyboard-only": !showZoomBar,
|
||||
})}
|
||||
>
|
||||
showZoomBar
|
||||
? html`<ha-card class="zoom-bar">
|
||||
<ha-icon-button
|
||||
.disabled=${!this._isZoomed()}
|
||||
.label=${this.hass.localize(
|
||||
@@ -359,11 +350,6 @@ class HaPanelHistory extends LitElement {
|
||||
.end=${this._zoomRange[1]}
|
||||
@zoom-slider-changed=${this._zoomSliderChanged}
|
||||
@zoom-slider-reset=${this._resetZoom}
|
||||
@pointerdown=${this._holdZoomBar}
|
||||
@focusin=${this._holdZoomBar}
|
||||
@pointerup=${this._releaseZoomBar}
|
||||
@pointercancel=${this._releaseZoomBar}
|
||||
@focusout=${this._releaseZoomBar}
|
||||
></ha-chart-zoom-slider>
|
||||
</ha-card>`
|
||||
: nothing
|
||||
@@ -384,7 +370,6 @@ class HaPanelHistory extends LitElement {
|
||||
ev: HASSDomEvent<HASSDomEvents["history-charts-zoom"]>
|
||||
) {
|
||||
this._zoomRange = [ev.detail.start, ev.detail.end];
|
||||
this._zoomBarHeld = false;
|
||||
}
|
||||
|
||||
private _zoomSliderChanged(
|
||||
@@ -395,18 +380,7 @@ class HaPanelHistory extends LitElement {
|
||||
this._stateHistoryCharts?.zoom(start, end);
|
||||
}
|
||||
|
||||
private _holdZoomBar() {
|
||||
this._zoomBarHeld = true;
|
||||
}
|
||||
|
||||
private _releaseZoomBar(ev: Event & HASSDomCurrentTargetEvent<HTMLElement>) {
|
||||
// A mouse press focuses the slider, so it is kept until it loses focus
|
||||
this._zoomBarHeld =
|
||||
ev.type !== "focusout" && ev.currentTarget.matches(":focus-within");
|
||||
}
|
||||
|
||||
private _resetZoom() {
|
||||
this._zoomBarHeld = false;
|
||||
this._zoomRange = [0, 100];
|
||||
this._stateHistoryCharts?.zoom(0, 100);
|
||||
}
|
||||
@@ -656,7 +630,6 @@ class HaPanelHistory extends LitElement {
|
||||
this._isLoading = true;
|
||||
// The charts are rebuilt once loaded, so they start unzoomed.
|
||||
this._zoomRange = [0, 100];
|
||||
this._zoomBarHeld = false;
|
||||
|
||||
if (this._subscribed) {
|
||||
this._unsubscribeHistory();
|
||||
@@ -1070,11 +1043,6 @@ class HaPanelHistory extends LitElement {
|
||||
);
|
||||
}
|
||||
|
||||
/* Kept in the tab order, as zooming from the keyboard starts here */
|
||||
.zoom-bar.keyboard-only {
|
||||
clip-path: inset(50%);
|
||||
}
|
||||
|
||||
/* Floats like the energy dashboard's date bar */
|
||||
.zoom-bar {
|
||||
position: absolute;
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { mdiArrowBottomLeft, mdiArrowTopRight, mdiStop } from "@mdi/js";
|
||||
import {
|
||||
mdiStop,
|
||||
mdiUnfoldLessHorizontal,
|
||||
mdiUnfoldMoreHorizontal,
|
||||
} from "@mdi/js";
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import { LitElement, html, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
@@ -124,7 +128,7 @@ class HuiCoverTiltCardFeature
|
||||
@click=${this._onOpenTap}
|
||||
.disabled=${!canOpenTilt(this._stateObj)}
|
||||
>
|
||||
<ha-svg-icon .path=${mdiArrowTopRight}></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiUnfoldMoreHorizontal}></ha-svg-icon>
|
||||
</ha-control-button>
|
||||
`
|
||||
: nothing
|
||||
@@ -150,7 +154,7 @@ class HuiCoverTiltCardFeature
|
||||
@click=${this._onCloseTap}
|
||||
.disabled=${!canCloseTilt(this._stateObj)}
|
||||
>
|
||||
<ha-svg-icon .path=${mdiArrowBottomLeft}></ha-svg-icon>
|
||||
<ha-svg-icon .path=${mdiUnfoldLessHorizontal}></ha-svg-icon>
|
||||
</ha-control-button>
|
||||
`
|
||||
: nothing
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import { css, html, LitElement, nothing, unsafeCSS } from "lit";
|
||||
import { css, html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { styleMap } from "lit/directives/style-map";
|
||||
import { consume } from "../../../common/decorators/consume";
|
||||
@@ -16,7 +16,10 @@ import { stateColorCss } from "../../../common/entity/state_color";
|
||||
import type { LocalizeFunc } from "../../../common/translations/localize";
|
||||
import "../../../components/ha-control-slider";
|
||||
import type { CoverEntity } from "../../../data/cover";
|
||||
import { coverSupportsTiltPosition } from "../../../data/cover";
|
||||
import {
|
||||
coverSupportsTiltPosition,
|
||||
coverTiltOpenness,
|
||||
} from "../../../data/cover";
|
||||
import {
|
||||
apiContext,
|
||||
entitiesContext,
|
||||
@@ -37,34 +40,29 @@ import type {
|
||||
LovelaceCardFeatureContext,
|
||||
} from "./types";
|
||||
|
||||
function generateTiltSliderTrackBackgroundGradient() {
|
||||
const count = 24;
|
||||
const minStrokeWidth = 0.2;
|
||||
const gradient: [number, string][] = [];
|
||||
const SLAT_COUNT = 24;
|
||||
const MIN_SLAT_WIDTH = 0.2;
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
const stopOffset1 = i / count;
|
||||
const stopOffset2 =
|
||||
stopOffset1 +
|
||||
(i / count ** 2) * (1 - minStrokeWidth) +
|
||||
minStrokeWidth / count;
|
||||
const computeTiltGradient = (stateObj: CoverEntity) => {
|
||||
const stops: string[] = [];
|
||||
|
||||
if (i !== 0) {
|
||||
gradient.push([stopOffset1, "transparent"]);
|
||||
}
|
||||
gradient.push([stopOffset1, "var(--control-slider-color)"]);
|
||||
gradient.push([stopOffset2, "var(--control-slider-color)"]);
|
||||
gradient.push([stopOffset2, "transparent"]);
|
||||
for (let i = 0; i < SLAT_COUNT; i++) {
|
||||
const tilt = ((i + 0.5) / SLAT_COUNT) * 100;
|
||||
const closedness = 1 - coverTiltOpenness(stateObj, tilt) / 100;
|
||||
const width = MIN_SLAT_WIDTH + (1 - MIN_SLAT_WIDTH) * closedness;
|
||||
const slatStart = ((i + (1 - width) / 2) / SLAT_COUNT) * 100;
|
||||
const slatEnd = ((i + (1 + width) / 2) / SLAT_COUNT) * 100;
|
||||
|
||||
stops.push(
|
||||
`transparent ${slatStart}%`,
|
||||
`var(--control-slider-color) ${slatStart}%`,
|
||||
`var(--control-slider-color) ${slatEnd}%`,
|
||||
`transparent ${slatEnd}%`
|
||||
);
|
||||
}
|
||||
|
||||
return unsafeCSS(
|
||||
gradient
|
||||
.map(([stop, color]) => `${color} ${(stop as number) * 100}%`)
|
||||
.join(", ")
|
||||
);
|
||||
}
|
||||
|
||||
const GRADIENT = generateTiltSliderTrackBackgroundGradient();
|
||||
return stops.join(", ");
|
||||
};
|
||||
|
||||
const supportsCoverTiltPositionCardFeatureFromState = (
|
||||
stateObj: HassEntity
|
||||
@@ -159,6 +157,10 @@ class HuiCoverTiltPositionCardFeature
|
||||
"--state-cover-inactive-color": openColor,
|
||||
};
|
||||
|
||||
const gradientStyle = {
|
||||
"--tilt-gradient": computeTiltGradient(this._stateObj),
|
||||
};
|
||||
|
||||
return html`
|
||||
<ha-control-slider
|
||||
style=${styleMap(style)}
|
||||
@@ -178,7 +180,11 @@ class HuiCoverTiltPositionCardFeature
|
||||
.unit=${DOMAIN_ATTRIBUTES_UNITS.cover.current_tilt_position}
|
||||
.locale=${this._locale}
|
||||
>
|
||||
<div slot="background" class="gradient"></div
|
||||
<div
|
||||
slot="background"
|
||||
class="gradient"
|
||||
style=${styleMap(gradientStyle)}
|
||||
></div
|
||||
></ha-control-slider>
|
||||
`;
|
||||
}
|
||||
@@ -198,9 +204,12 @@ class HuiCoverTiltPositionCardFeature
|
||||
cardFeatureStyles,
|
||||
css`
|
||||
.gradient {
|
||||
background: linear-gradient(to right, ${GRADIENT});
|
||||
background: linear-gradient(to left, var(--tilt-gradient));
|
||||
opacity: 0.6;
|
||||
}
|
||||
.gradient:dir(rtl) {
|
||||
background: linear-gradient(to right, var(--tilt-gradient));
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
coverSupportsPosition,
|
||||
coverSupportsSetValue,
|
||||
coverSupportsTiltPosition,
|
||||
coverTiltOpenness,
|
||||
isMoving,
|
||||
isOpening,
|
||||
} from "../../data/cover";
|
||||
@@ -573,12 +574,12 @@ export class HaStateControlCover extends LitElement {
|
||||
return this._formatValue(value);
|
||||
}
|
||||
|
||||
private _drawnTilt(): number {
|
||||
private _drawnTiltOpenness(): number {
|
||||
if (this.mode === "tilt" && this._drag) {
|
||||
return this._drag.value;
|
||||
return coverTiltOpenness(this.stateObj, this._drag.value);
|
||||
}
|
||||
return coverHasTiltControls(this.stateObj)
|
||||
? this._coverSprings.tilt.value
|
||||
? coverTiltOpenness(this.stateObj, this._coverSprings.tilt.value)
|
||||
: 0;
|
||||
}
|
||||
|
||||
@@ -689,7 +690,7 @@ export class HaStateControlCover extends LitElement {
|
||||
const withTarget = changing && (unknown || Math.abs(handle - cover) > 1);
|
||||
const parts = shape.render({
|
||||
position: this._coverSprings.position.value,
|
||||
tilt: this._drawnTilt(),
|
||||
tiltOpenness: this._drawnTiltOpenness(),
|
||||
wave: this._wave,
|
||||
});
|
||||
const flip = isHorizontal(shape) && this._isRtl;
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface CoverWave {
|
||||
|
||||
export interface CoverShapeInput {
|
||||
position: number;
|
||||
tilt: number;
|
||||
tiltOpenness: number;
|
||||
wave: CoverWave;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ const PITCH = 12;
|
||||
|
||||
export const slatsShape: CoverShape = {
|
||||
...tiltGeometry,
|
||||
render: ({ tilt }) => {
|
||||
render: ({ tiltOpenness }) => {
|
||||
const count = Math.floor(FRAME.height / PITCH);
|
||||
const thickness = Math.max(1.2, (PITCH - 1) * (1 - tilt / 100));
|
||||
const thickness = Math.max(1.2, (PITCH - 1) * (1 - tiltOpenness / 100));
|
||||
return {
|
||||
cover: Array.from({ length: count }, (_, index) =>
|
||||
slat(FRAME.top + index * PITCH + (PITCH - thickness) / 2, thickness)
|
||||
|
||||
@@ -11,9 +11,9 @@ const CORDS = [0.22, 0.78];
|
||||
|
||||
export const venetianShape: CoverShape = {
|
||||
...rollingGeometry,
|
||||
render: ({ position, tilt }) => {
|
||||
render: ({ position, tiltOpenness }) => {
|
||||
const { left, top, width, height } = FRAME;
|
||||
const thickness = 9 - (7 * clampPercent(tilt)) / 100;
|
||||
const thickness = 9 - (7 * clampPercent(tiltOpenness)) / 100;
|
||||
const count = Math.ceil(height / PITCH) + 1;
|
||||
const first = top + thickness / 2;
|
||||
const pitch = (top + height - thickness / 2 - first) / (count - 1);
|
||||
|
||||
Reference in new issue
Block a user