Compare commits

..

66 Commits

Author SHA1 Message Date
Bram Kragten
ccc48d158a Bumped version to 20251105.1 2025-11-21 13:50:20 +01:00
Bram Kragten
b11e787f09 Dont add store token for external auth flows (#28026)
* Dont add store token for external auth flows

* Apply suggestion from @MindFreeze

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
2025-11-21 13:50:04 +01:00
renovate[bot]
cdb6562de8 Update dependency js-yaml to v4.1.1 [SECURITY] (#27955)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 13:48:48 +01:00
karwosts
d8e8c9aa02 Fix media image on dashboard-level background (#27934) 2025-11-21 13:48:10 +01:00
Petar Petrov
be392be1e6 Increase ZHA reconfiguration dialog width for details view (#27909) 2025-11-21 13:44:41 +01:00
Petar Petrov
10dc432445 Fix entity name in statistics chart (#27896) 2025-11-21 13:44:40 +01:00
Wendelin
19187f887d Fix target picker for entity_id: none (#27893)
Fix notFound condition to exclude 'none' in ha-target-picker-item-row
2025-11-21 13:44:40 +01:00
Petar Petrov
dc76a42aaa Smooth sensor card more when "Show more detail" is disabled (#27891)
* Smooth sensor card more when "Show more detail" is disabled

* Set minimum sample points to 10
2025-11-21 13:44:38 +01:00
Wendelin
1f2b8047a6 Use ha-ripple in ha-md-list-item (#27889) 2025-11-21 13:44:38 +01:00
Petar Petrov
e8c9ed0528 Dynamic total energy for pie chart (#27883) 2025-11-21 13:44:37 +01:00
Petar Petrov
c7ae78c02f Fix chart label outline color (#27882) 2025-11-21 13:44:36 +01:00
karwosts
dc8f1211e6 Fix entity editor with non-existant entity (#27875) 2025-11-21 13:44:35 +01:00
Yuksel Beyti
5c25a63ea5 Fix malformed HTML tags in backup backups component (#27872) 2025-11-21 13:44:34 +01:00
Paul Bottein
c1787ab994 Fix backup download and delete actions (#27851) 2025-11-21 13:44:33 +01:00
Paul Bottein
6fea535fdc Fix OHF logo theme (#27830) 2025-11-21 13:44:32 +01:00
Wendelin
e8cee84380 Fix floor details area picker (#27827) 2025-11-21 13:44:31 +01:00
Wendelin
b4613edeb7 Target picker row check if not found entity isn't "all" (#27826)
Target picker row check if not found entity isn't all
2025-11-21 13:44:30 +01:00
Wendelin
a8b6e5aa3d Add trigger/condition/action dialog: select single search result with enter key (#27825)
* Add trigger/condition/action dialog: select single search result with enter key

* Update src/panels/config/automation/add-automation-element-dialog.ts

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
2025-11-21 13:44:29 +01:00
Jan Bouwhuis
e842193cd6 Fix index for service action translation in service action dialog (#27824) 2025-11-21 13:44:28 +01:00
Bram Kragten
bb0813333d Fix landing page build (#27817) 2025-11-21 13:44:27 +01:00
Petar Petrov
ab4c6f80f4 Disable graph resize animation for general resizing (#27816) 2025-11-21 13:44:26 +01:00
Bram Kragten
89796e425a Bumped version to 20251105.0 2025-11-05 15:26:35 +01:00
Wendelin
9c42c8bbc4 Add fallback icon for domain template (#27814) 2025-11-05 15:25:54 +01:00
Wendelin
616237caee Fix target picker with empty sections (#27813) 2025-11-05 15:25:53 +01:00
Wendelin
2d36a0d37f Add trigger/condition/action dialog - Show device group always on top (#27812)
add automation element dialog Device always on top
2025-11-05 15:25:52 +01:00
Wendelin
1ec432a20f Change add trigger/condition/action dialog title (#27811)
Change add dialog title
2025-11-05 15:25:51 +01:00
Wendelin
afd91b2261 Fix auth language picker styles (#27805) 2025-11-05 15:25:50 +01:00
Paul Bottein
cdfb7f914f Fix target picker in logbook card editor (#27804)
Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>
2025-11-05 15:24:49 +01:00
Wendelin
33b0897522 Add trigger/condition/action dialog: fix empty elements in search results (#27802) 2025-11-05 15:16:14 +01:00
Wendelin
5f0cf1b522 Add condition/action dialog: blocks title (#27801) 2025-11-05 15:16:13 +01:00
Wendelin
afb2ad95a4 Fix target picker in card editor (#27800) 2025-11-05 15:16:12 +01:00
Jan-Philipp Benecke
27beab3133 Fix z-index for target picker item row icon (#27798) 2025-11-05 15:16:10 +01:00
Wendelin
435c82489b Fix assist conversation language picker (#27764) 2025-11-05 15:16:09 +01:00
Bram Kragten
3ba6bf272e Bumped version to 20251104.0 2025-11-04 18:21:11 +01:00
Paul Bottein
eec99b2fa3 Rename safety panel to security panel (#27796) 2025-11-04 18:20:10 +01:00
Bram Kragten
d23e45e410 Handle unknown items in target picker (#27795)
* Handle unknown items in target picker

* Update ha-target-picker-item-row.ts

* update colors

* fallback to domain icons
2025-11-04 18:19:02 +01:00
Paul Bottein
3c82d12609 Auto refresh summary dashboard when registries changed (#27794) 2025-11-04 18:17:46 +01:00
Paul Bottein
15d67997e7 Don't show summary card if summary dashboards are empty (#27788)
Don't show summary card if summary dashboard are empty
2025-11-04 18:16:37 +01:00
Paul Bottein
a6dfcb3100 Fix tooltip hide delay (#27786) 2025-11-04 18:16:37 +01:00
karwosts
26c2369228 Fix sankey with external statistics devices (#27784) 2025-11-04 18:16:35 +01:00
Paul Bottein
2eed446492 Display entities without area in summary dashboard (#27777)
* Add support for no area, no floor and no device in entity filter

* Display entities without area in summary dashboard
2025-11-04 18:16:34 +01:00
Wendelin
7ebdeab6b2 Fix-labels-yaml-helper (#27776)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2025-11-04 18:16:33 +01:00
Tobias Bieniek
0c35278f51 Hide media players summary when no entities exist (#27642) 2025-11-04 18:16:32 +01:00
Bram Kragten
561122f03d Bumped version to 20251103.0 2025-11-03 16:34:11 +01:00
Petar Petrov
95311be034 Apply theme variables to pi charts (#27773) 2025-11-03 16:34:07 +01:00
Wendelin
1eda44a102 Fix selected element text color (#27771) 2025-11-03 16:32:51 +01:00
Petar Petrov
d76781eb91 Fix for Y axis label formatting in history graph (#27770) 2025-11-03 16:32:50 +01:00
Petar Petrov
82d44e051f Fix sensor card graph in Safari (#27768) 2025-11-03 16:32:49 +01:00
Aidan Timson
fdc9f5a3b7 Use supervisor endpoint for downloading logs (when avaliable) (#27765) 2025-11-03 16:32:47 +01:00
Paul Bottein
ee6c82aba9 Don't show tooltip on overflow menu in dashboard toolbar (#27763) 2025-11-03 16:32:46 +01:00
Paul Bottein
11d3f5c2ba Fix suggest cards dialog for sections view (#27762) 2025-11-03 16:32:45 +01:00
Aarni Koskela
feb68ce373 Add support for PM4 sensor state (#27754) 2025-11-03 16:32:44 +01:00
Simon Lamon
7f9a9de157 Move label translations to ui.dialog (#27752) 2025-11-03 16:32:43 +01:00
Simon Lamon
8e1b6a3d3b Fixes in backup overflow (#27745)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2025-11-03 16:32:41 +01:00
Jan-Philipp Benecke
6e6e5a53e2 Fix button text overflow (#27744) 2025-11-03 16:32:41 +01:00
Bram Kragten
0408734ec5 Bumped version to 20251029.1 2025-10-30 18:19:31 +01:00
Paul Bottein
317519fc08 Revert "Fix entities card size and add grid contstraints" (#27725) 2025-10-30 18:18:27 +01:00
Paul Bottein
843d79eab4 Don't show tooltip for ha button menu in top bar (#27723) 2025-10-30 18:18:26 +01:00
Paul Bottein
165a757f06 Revert entity naming in target picker chips (#27722) 2025-10-30 18:18:25 +01:00
Aidan Timson
ea8b730142 Revert "Migrate dialog-device-registry-detail to ha-wa-dialog (#27668)" (#27716)
This reverts commit 2a8d935601.
2025-10-30 18:18:24 +01:00
Paul Bottein
e88c97d625 Use entity naming in more cards (#27714)
* Use entity naming in more cards

* Migrate statistic card

* Fix localize
2025-10-30 18:18:23 +01:00
Aidan Timson
7560988b76 Trend feature: make sure content is centered when loading (#27708)
* Make sure content is centered when loading

* Restore from test
2025-10-30 18:18:22 +01:00
Aidan Timson
eecd8077b6 Calendar card height: account for title and stop overflow (#27707) 2025-10-30 18:18:21 +01:00
Paul Bottein
cbab5c3f7b Restore trigger id in overflow menu for trigger (#27702) 2025-10-30 18:18:20 +01:00
Paul Bottein
a5d27c8bb8 Only clear from and to trigger in state trigger (#27700) 2025-10-30 18:18:19 +01:00
Paul Bottein
a6a340b5db Only display add button if at least one entity is selected in entities picker (#27699) 2025-10-30 18:18:18 +01:00
80 changed files with 1657 additions and 955 deletions

View File

@@ -18,16 +18,16 @@ module.exports.sourceMapURL = () => {
module.exports.ignorePackages = () => []; module.exports.ignorePackages = () => [];
// Files from NPM packages that we should replace with empty file // Files from NPM packages that we should replace with empty file
module.exports.emptyPackages = ({ isHassioBuild }) => module.exports.emptyPackages = ({ isHassioBuild, isLandingPageBuild }) =>
[ [
require.resolve("@vaadin/vaadin-material-styles/typography.js"), require.resolve("@vaadin/vaadin-material-styles/typography.js"),
require.resolve("@vaadin/vaadin-material-styles/font-icons.js"), require.resolve("@vaadin/vaadin-material-styles/font-icons.js"),
// Icons in supervisor conflict with icons in HA so we don't load. // Icons in supervisor conflict with icons in HA so we don't load.
isHassioBuild && (isHassioBuild || isLandingPageBuild) &&
require.resolve( require.resolve(
path.resolve(paths.root_dir, "src/components/ha-icon.ts") path.resolve(paths.root_dir, "src/components/ha-icon.ts")
), ),
isHassioBuild && (isHassioBuild || isLandingPageBuild) &&
require.resolve( require.resolve(
path.resolve(paths.root_dir, "src/components/ha-icon-picker.ts") path.resolve(paths.root_dir, "src/components/ha-icon-picker.ts")
), ),
@@ -337,6 +337,7 @@ module.exports.config = {
publicPath: publicPath(latestBuild), publicPath: publicPath(latestBuild),
isProdBuild, isProdBuild,
latestBuild, latestBuild,
isLandingPageBuild: true,
}; };
}, },
}; };

View File

@@ -41,6 +41,7 @@ const createRspackConfig = ({
isStatsBuild, isStatsBuild,
isTestBuild, isTestBuild,
isHassioBuild, isHassioBuild,
isLandingPageBuild,
dontHash, dontHash,
}) => { }) => {
if (!dontHash) { if (!dontHash) {
@@ -168,7 +169,9 @@ const createRspackConfig = ({
}, },
}), }),
new rspack.NormalModuleReplacementPlugin( new rspack.NormalModuleReplacementPlugin(
new RegExp(bundle.emptyPackages({ isHassioBuild }).join("|")), new RegExp(
bundle.emptyPackages({ isHassioBuild, isLandingPageBuild }).join("|")
),
path.resolve(paths.root_dir, "src/util/empty.js") path.resolve(paths.root_dir, "src/util/empty.js")
), ),
!isProdBuild && new LogStartCompilePlugin(), !isProdBuild && new LogStartCompilePlugin(),

View File

@@ -39,6 +39,7 @@ const SENSOR_DEVICE_CLASSES = [
"pm1", "pm1",
"pm10", "pm10",
"pm25", "pm25",
"pm4",
"power_factor", "power_factor",
"power", "power",
"precipitation", "precipitation",

View File

@@ -1,22 +1,25 @@
import "@material/mwc-linear-progress"; import "@material/mwc-linear-progress";
import { type PropertyValues, css, html, nothing } from "lit"; import { mdiOpenInNew } from "@mdi/js";
import { css, html, nothing, type PropertyValues } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { extractSearchParam } from "../../src/common/url/search-params";
import "../../src/components/ha-alert"; import "../../src/components/ha-alert";
import "../../src/components/ha-button";
import "../../src/components/ha-fade-in"; import "../../src/components/ha-fade-in";
import "../../src/components/ha-spinner"; import "../../src/components/ha-spinner";
import { haStyle } from "../../src/resources/styles"; import "../../src/components/ha-svg-icon";
import "../../src/onboarding/onboarding-welcome-links";
import "./components/landing-page-network";
import "./components/landing-page-logs";
import { extractSearchParam } from "../../src/common/url/search-params";
import { onBoardingStyles } from "../../src/onboarding/styles";
import { makeDialogManager } from "../../src/dialogs/make-dialog-manager"; import { makeDialogManager } from "../../src/dialogs/make-dialog-manager";
import { LandingPageBaseElement } from "./landing-page-base-element"; import "../../src/onboarding/onboarding-welcome-links";
import { onBoardingStyles } from "../../src/onboarding/styles";
import { haStyle } from "../../src/resources/styles";
import "./components/landing-page-logs";
import "./components/landing-page-network";
import { import {
getSupervisorNetworkInfo, getSupervisorNetworkInfo,
pingSupervisor, pingSupervisor,
type NetworkInfo, type NetworkInfo,
} from "./data/supervisor"; } from "./data/supervisor";
import { LandingPageBaseElement } from "./landing-page-base-element";
export const ASSUME_CORE_START_SECONDS = 60; export const ASSUME_CORE_START_SECONDS = 60;
const SCHEDULE_CORE_CHECK_SECONDS = 1; const SCHEDULE_CORE_CHECK_SECONDS = 1;
@@ -94,16 +97,21 @@ class HaLandingPage extends LandingPageBaseElement {
<ha-language-picker <ha-language-picker
.value=${this.language} .value=${this.language}
.label=${""} .label=${""}
button-style
native-name native-name
@value-changed=${this._languageChanged} @value-changed=${this._languageChanged}
inline-arrow inline-arrow
></ha-language-picker> ></ha-language-picker>
<a <ha-button
appearance="plain"
variant="neutral"
href="https://www.home-assistant.io/getting-started/onboarding/" href="https://www.home-assistant.io/getting-started/onboarding/"
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
>${this.localize("ui.panel.page-onboarding.help")}</a
> >
${this.localize("ui.panel.page-onboarding.help")}
<ha-svg-icon slot="end" .path=${mdiOpenInNew}></ha-svg-icon>
</ha-button>
</div> </div>
`; `;
} }
@@ -218,26 +226,8 @@ class HaLandingPage extends LandingPageBaseElement {
ha-alert p { ha-alert p {
text-align: unset; text-align: unset;
} }
ha-language-picker { .footer ha-svg-icon {
display: block; --mdc-icon-size: var(--ha-space-5);
width: 200px;
border-radius: var(--ha-border-radius-sm);
overflow: hidden;
--ha-select-height: 40px;
--mdc-select-fill-color: none;
--mdc-select-label-ink-color: var(--primary-text-color, #212121);
--mdc-select-ink-color: var(--primary-text-color, #212121);
--mdc-select-idle-line-color: transparent;
--mdc-select-hover-line-color: transparent;
--mdc-select-dropdown-icon-color: var(--primary-text-color, #212121);
--mdc-shape-small: 0;
}
a {
text-decoration: none;
color: var(--primary-text-color);
margin-right: 16px;
margin-inline-end: 16px;
margin-inline-start: initial;
} }
ha-fade-in { ha-fade-in {
min-height: calc(100vh - 64px - 88px); min-height: calc(100vh - 64px - 88px);

View File

@@ -115,7 +115,7 @@
"home-assistant-js-websocket": "9.5.0", "home-assistant-js-websocket": "9.5.0",
"idb-keyval": "6.2.2", "idb-keyval": "6.2.2",
"intl-messageformat": "10.7.18", "intl-messageformat": "10.7.18",
"js-yaml": "4.1.0", "js-yaml": "4.1.1",
"leaflet": "1.9.4", "leaflet": "1.9.4",
"leaflet-draw": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch", "leaflet-draw": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch",
"leaflet.markercluster": "1.5.3", "leaflet.markercluster": "1.5.3",
@@ -157,7 +157,7 @@
"@octokit/auth-oauth-device": "8.0.2", "@octokit/auth-oauth-device": "8.0.2",
"@octokit/plugin-retry": "8.0.2", "@octokit/plugin-retry": "8.0.2",
"@octokit/rest": "22.0.0", "@octokit/rest": "22.0.0",
"@rsdoctor/rspack-plugin": "1.3.6", "@rsdoctor/rspack-plugin": "1.3.4",
"@rspack/core": "1.5.8", "@rspack/core": "1.5.8",
"@rspack/dev-server": "1.1.4", "@rspack/dev-server": "1.1.4",
"@types/babel__plugin-transform-runtime": "7.9.5", "@types/babel__plugin-transform-runtime": "7.9.5",
@@ -178,7 +178,7 @@
"@types/tar": "6.1.13", "@types/tar": "6.1.13",
"@types/ua-parser-js": "0.7.39", "@types/ua-parser-js": "0.7.39",
"@types/webspeechapi": "0.0.29", "@types/webspeechapi": "0.0.29",
"@vitest/coverage-v8": "4.0.4", "@vitest/coverage-v8": "4.0.3",
"babel-loader": "10.0.0", "babel-loader": "10.0.0",
"babel-plugin-template-html-minifier": "4.1.0", "babel-plugin-template-html-minifier": "4.1.0",
"browserslist-useragent-regexp": "4.1.3", "browserslist-useragent-regexp": "4.1.3",
@@ -219,7 +219,7 @@
"typescript": "5.9.3", "typescript": "5.9.3",
"typescript-eslint": "8.46.2", "typescript-eslint": "8.46.2",
"vite-tsconfig-paths": "5.1.4", "vite-tsconfig-paths": "5.1.4",
"vitest": "4.0.4", "vitest": "4.0.3",
"webpack-stats-plugin": "1.1.3", "webpack-stats-plugin": "1.1.3",
"webpackbar": "7.0.0", "webpackbar": "7.0.0",
"workbox-build": "patch:workbox-build@npm%3A7.1.1#~/.yarn/patches/workbox-build-npm-7.1.1-a854f3faae.patch" "workbox-build": "patch:workbox-build@npm%3A7.1.1#~/.yarn/patches/workbox-build-npm-7.1.1-a854f3faae.patch"

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "home-assistant-frontend" name = "home-assistant-frontend"
version = "20251029.0" version = "20251105.1"
license = "Apache-2.0" license = "Apache-2.0"
license-files = ["LICENSE*"] license-files = ["LICENSE*"]
description = "The Home Assistant frontend" description = "The Home Assistant frontend"

View File

@@ -59,7 +59,8 @@ export class HaAuthFlow extends LitElement {
willUpdate(changedProps: PropertyValues) { willUpdate(changedProps: PropertyValues) {
super.willUpdate(changedProps); super.willUpdate(changedProps);
if (!this.hasUpdated) { if (!this.hasUpdated && this.clientId === genClientId()) {
// Preselect store token when logging in to own instance
this._storeToken = this.initStoreToken; this._storeToken = this.initStoreToken;
} }

View File

@@ -1,4 +1,5 @@
/* eslint-disable lit/prefer-static-styles */ /* eslint-disable lit/prefer-static-styles */
import { mdiOpenInNew } from "@mdi/js";
import type { PropertyValues } from "lit"; import type { PropertyValues } from "lit";
import { html, LitElement, nothing } from "lit"; import { html, LitElement, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
@@ -6,6 +7,8 @@ import punycode from "punycode";
import { applyThemesOnElement } from "../common/dom/apply_themes_on_element"; import { applyThemesOnElement } from "../common/dom/apply_themes_on_element";
import { extractSearchParamsObject } from "../common/url/search-params"; import { extractSearchParamsObject } from "../common/url/search-params";
import "../components/ha-alert"; import "../components/ha-alert";
import "../components/ha-button";
import "../components/ha-svg-icon";
import type { AuthProvider, AuthUrlSearchParams } from "../data/auth"; import type { AuthProvider, AuthUrlSearchParams } from "../data/auth";
import { fetchAuthProviders } from "../data/auth"; import { fetchAuthProviders } from "../data/auth";
import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin"; import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin";
@@ -133,25 +136,8 @@ export class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
ha-language-picker { .footer ha-svg-icon {
width: 200px; --mdc-icon-size: var(--ha-space-5);
border-radius: var(--ha-border-radius-sm);
overflow: hidden;
--ha-select-height: 40px;
--mdc-select-fill-color: none;
--mdc-select-label-ink-color: var(--primary-text-color, #212121);
--mdc-select-ink-color: var(--primary-text-color, #212121);
--mdc-select-idle-line-color: transparent;
--mdc-select-hover-line-color: transparent;
--mdc-select-dropdown-icon-color: var(--primary-text-color, #212121);
--mdc-shape-small: 0;
}
.footer a {
text-decoration: none;
color: var(--primary-text-color);
margin-right: 16px;
margin-inline-end: 16px;
margin-inline-start: initial;
} }
h1 { h1 {
font-size: var(--ha-font-size-3xl); font-size: var(--ha-font-size-3xl);
@@ -205,16 +191,21 @@ export class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
<ha-language-picker <ha-language-picker
.value=${this.language} .value=${this.language}
.label=${""} .label=${""}
button-style
native-name native-name
@value-changed=${this._languageChanged} @value-changed=${this._languageChanged}
inline-arrow inline-arrow
></ha-language-picker> ></ha-language-picker>
<a <ha-button
appearance="plain"
variant="neutral"
href="https://www.home-assistant.io/docs/authentication/" href="https://www.home-assistant.io/docs/authentication/"
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
>${this.localize("ui.panel.page-authorize.help")}</a
> >
${this.localize("ui.panel.page-authorize.help")}
<ha-svg-icon slot="end" .path=${mdiOpenInNew}></ha-svg-icon>
</ha-button>
</div> </div>
`; `;
} }

View File

@@ -9,9 +9,9 @@ type EntityCategory = "none" | "config" | "diagnostic";
export interface EntityFilter { export interface EntityFilter {
domain?: string | string[]; domain?: string | string[];
device_class?: string | string[]; device_class?: string | string[];
device?: string | string[]; device?: string | null | (string | null)[];
area?: string | string[]; area?: string | null | (string | null)[];
floor?: string | string[]; floor?: string | null | (string | null)[];
label?: string | string[]; label?: string | string[];
entity_category?: EntityCategory | EntityCategory[]; entity_category?: EntityCategory | EntityCategory[];
hidden_platform?: string | string[]; hidden_platform?: string | string[];
@@ -19,6 +19,18 @@ export interface EntityFilter {
export type EntityFilterFunc = (entityId: string) => boolean; export type EntityFilterFunc = (entityId: string) => boolean;
const normalizeFilterArray = <T>(
value: T | null | T[] | (T | null)[] | undefined
): Set<T | null> | undefined => {
if (value === undefined) {
return undefined;
}
if (value === null) {
return new Set([null]);
}
return new Set(ensureArray(value));
};
export const generateEntityFilter = ( export const generateEntityFilter = (
hass: HomeAssistant, hass: HomeAssistant,
filter: EntityFilter filter: EntityFilter
@@ -29,11 +41,9 @@ export const generateEntityFilter = (
const deviceClasses = filter.device_class const deviceClasses = filter.device_class
? new Set(ensureArray(filter.device_class)) ? new Set(ensureArray(filter.device_class))
: undefined; : undefined;
const floors = filter.floor ? new Set(ensureArray(filter.floor)) : undefined; const floors = normalizeFilterArray(filter.floor);
const areas = filter.area ? new Set(ensureArray(filter.area)) : undefined; const areas = normalizeFilterArray(filter.area);
const devices = filter.device const devices = normalizeFilterArray(filter.device);
? new Set(ensureArray(filter.device))
: undefined;
const entityCategories = filter.entity_category const entityCategories = filter.entity_category
? new Set(ensureArray(filter.entity_category)) ? new Set(ensureArray(filter.entity_category))
: undefined; : undefined;
@@ -73,23 +83,20 @@ export const generateEntityFilter = (
} }
if (floors) { if (floors) {
if (!floor || !floors.has(floor.floor_id)) { const floorId = floor?.floor_id ?? null;
if (!floors.has(floorId)) {
return false; return false;
} }
} }
if (areas) { if (areas) {
if (!area) { const areaId = area?.area_id ?? null;
return false; if (!areas.has(areaId)) {
}
if (!areas.has(area.area_id)) {
return false; return false;
} }
} }
if (devices) { if (devices) {
if (!device) { const deviceId = device?.id ?? null;
return false; if (!devices.has(deviceId)) {
}
if (!devices.has(device.id)) {
return false; return false;
} }
} }

View File

@@ -214,6 +214,7 @@ const FIXED_DOMAIN_ATTRIBUTE_STATES = {
"pm1", "pm1",
"pm10", "pm10",
"pm25", "pm25",
"pm4",
"power_factor", "power_factor",
"power", "power",
"pressure", "pressure",

View File

@@ -6,7 +6,8 @@ export function downSampleLineData<
data: T[] | undefined, data: T[] | undefined,
maxDetails: number, maxDetails: number,
minX?: number, minX?: number,
maxX?: number maxX?: number,
useMean = false
): T[] { ): T[] {
if (!data) { if (!data) {
return []; return [];
@@ -17,15 +18,13 @@ export function downSampleLineData<
const min = minX ?? getPointData(data[0]!)[0]; const min = minX ?? getPointData(data[0]!)[0];
const max = maxX ?? getPointData(data[data.length - 1]!)[0]; const max = maxX ?? getPointData(data[data.length - 1]!)[0];
const step = Math.ceil((max - min) / Math.floor(maxDetails)); const step = Math.ceil((max - min) / Math.floor(maxDetails));
const frames = new Map<
number,
{
min: { point: (typeof data)[number]; x: number; y: number };
max: { point: (typeof data)[number]; x: number; y: number };
}
>();
// Group points into frames // Group points into frames
const frames = new Map<
number,
{ point: (typeof data)[number]; x: number; y: number }[]
>();
for (const point of data) { for (const point of data) {
const pointData = getPointData(point); const pointData = getPointData(point);
if (!Array.isArray(pointData)) continue; if (!Array.isArray(pointData)) continue;
@@ -36,28 +35,53 @@ export function downSampleLineData<
const frameIndex = Math.floor((x - min) / step); const frameIndex = Math.floor((x - min) / step);
const frame = frames.get(frameIndex); const frame = frames.get(frameIndex);
if (!frame) { if (!frame) {
frames.set(frameIndex, { min: { point, x, y }, max: { point, x, y } }); frames.set(frameIndex, [{ point, x, y }]);
} else { } else {
if (frame.min.y > y) { frame.push({ point, x, y });
frame.min = { point, x, y };
}
if (frame.max.y < y) {
frame.max = { point, x, y };
}
} }
} }
// Convert frames back to points // Convert frames back to points
const result: T[] = []; const result: T[] = [];
for (const [_i, frame] of frames) {
// Use min/max points to preserve visual accuracy if (useMean) {
// The order of the data must be preserved so max may be before min // Use mean values for each frame
if (frame.min.x > frame.max.x) { for (const [_i, framePoints] of frames) {
result.push(frame.max.point); const sumY = framePoints.reduce((acc, p) => acc + p.y, 0);
const meanY = sumY / framePoints.length;
const sumX = framePoints.reduce((acc, p) => acc + p.x, 0);
const meanX = sumX / framePoints.length;
const firstPoint = framePoints[0].point;
const pointData = getPointData(firstPoint);
const meanPoint = (
Array.isArray(pointData) ? [meanX, meanY] : { value: [meanX, meanY] }
) as T;
result.push(meanPoint);
} }
result.push(frame.min.point); } else {
if (frame.min.x < frame.max.x) { // Use min/max values for each frame
result.push(frame.max.point); for (const [_i, framePoints] of frames) {
let minPoint = framePoints[0];
let maxPoint = framePoints[0];
for (const p of framePoints) {
if (p.y < minPoint.y) {
minPoint = p;
}
if (p.y > maxPoint.y) {
maxPoint = p;
}
}
// The order of the data must be preserved so max may be before min
if (minPoint.x > maxPoint.x) {
result.push(maxPoint.point);
}
result.push(minPoint.point);
if (minPoint.x < maxPoint.x) {
result.push(maxPoint.point);
}
} }
} }

View File

@@ -35,7 +35,6 @@ export const MIN_TIME_BETWEEN_UPDATES = 60 * 5 * 1000;
const LEGEND_OVERFLOW_LIMIT = 10; const LEGEND_OVERFLOW_LIMIT = 10;
const LEGEND_OVERFLOW_LIMIT_MOBILE = 6; const LEGEND_OVERFLOW_LIMIT_MOBILE = 6;
const DOUBLE_TAP_TIME = 300; const DOUBLE_TAP_TIME = 300;
const RESIZE_ANIMATION_DURATION = 250;
export type CustomLegendOption = ECOption["legend"] & { export type CustomLegendOption = ECOption["legend"] & {
type: "custom"; type: "custom";
@@ -91,6 +90,8 @@ export class HaChartBase extends LitElement {
private _shouldResizeChart = false; private _shouldResizeChart = false;
private _resizeAnimationDuration?: number;
// @ts-ignore // @ts-ignore
private _resizeController = new ResizeController(this, { private _resizeController = new ResizeController(this, {
callback: () => { callback: () => {
@@ -214,6 +215,7 @@ export class HaChartBase extends LitElement {
) { ) {
// custom legend changes may require a resize to layout properly // custom legend changes may require a resize to layout properly
this._shouldResizeChart = true; this._shouldResizeChart = true;
this._resizeAnimationDuration = 250;
} }
} else if (this._isTouchDevice && changedProps.has("_isZoomed")) { } else if (this._isTouchDevice && changedProps.has("_isZoomed")) {
chartOptions.dataZoom = this._getDataZoomConfig(); chartOptions.dataZoom = this._getDataZoomConfig();
@@ -625,6 +627,10 @@ export class HaChartBase extends LitElement {
} }
private _createTheme(style: CSSStyleDeclaration) { private _createTheme(style: CSSStyleDeclaration) {
const textBorderColor =
style.getPropertyValue("--ha-card-background") ||
style.getPropertyValue("--card-background-color");
const textBorderWidth = 2;
return { return {
color: getAllGraphColors(style), color: getAllGraphColors(style),
backgroundColor: "transparent", backgroundColor: "transparent",
@@ -648,15 +654,22 @@ export class HaChartBase extends LitElement {
graph: { graph: {
label: { label: {
color: style.getPropertyValue("--primary-text-color"), color: style.getPropertyValue("--primary-text-color"),
textBorderColor: style.getPropertyValue("--primary-background-color"), textBorderColor,
textBorderWidth: 2, textBorderWidth,
},
},
pie: {
label: {
color: style.getPropertyValue("--primary-text-color"),
textBorderColor,
textBorderWidth,
}, },
}, },
sankey: { sankey: {
label: { label: {
color: style.getPropertyValue("--primary-text-color"), color: style.getPropertyValue("--primary-text-color"),
textBorderColor: style.getPropertyValue("--primary-background-color"), textBorderColor,
textBorderWidth: 2, textBorderWidth,
}, },
}, },
categoryAxis: { categoryAxis: {
@@ -970,11 +983,14 @@ export class HaChartBase extends LitElement {
private _handleChartRenderFinished = () => { private _handleChartRenderFinished = () => {
if (this._shouldResizeChart) { if (this._shouldResizeChart) {
this.chart?.resize({ this.chart?.resize({
animation: this._reducedMotion animation:
? undefined this._reducedMotion ||
: { duration: RESIZE_ANIMATION_DURATION }, typeof this._resizeAnimationDuration !== "number"
? undefined
: { duration: this._resizeAnimationDuration },
}); });
this._shouldResizeChart = false; this._shouldResizeChart = false;
this._resizeAnimationDuration = undefined;
} }
}; };

View File

@@ -87,6 +87,8 @@ export class StateHistoryChartLine extends LitElement {
private _previousYAxisLabelValue = 0; private _previousYAxisLabelValue = 0;
private _yAxisMaximumFractionDigits = 0;
protected render() { protected render() {
return html` return html`
<ha-chart-base <ha-chart-base
@@ -757,8 +759,12 @@ export class StateHistoryChartLine extends LitElement {
Math.log10(Math.abs(value - this._previousYAxisLabelValue || 1)) Math.log10(Math.abs(value - this._previousYAxisLabelValue || 1))
) )
); );
this._yAxisMaximumFractionDigits = Math.max(
this._yAxisMaximumFractionDigits,
maximumFractionDigits
);
const label = formatNumber(value, this.hass.locale, { const label = formatNumber(value, this.hass.locale, {
maximumFractionDigits, maximumFractionDigits: this._yAxisMaximumFractionDigits,
}); });
const width = measureTextWidth(label, 12) + 5; const width = measureTextWidth(label, 12) + 5;
if (width > this._yWidth) { if (width > this._yWidth) {

View File

@@ -87,6 +87,8 @@ export class HaAreaPicker extends LitElement {
@property({ type: Boolean }) public required = false; @property({ type: Boolean }) public required = false;
@property({ attribute: "add-button-label" }) public addButtonLabel?: string;
@query("ha-generic-picker") private _picker?: HaGenericPicker; @query("ha-generic-picker") private _picker?: HaGenericPicker;
public async open() { public async open() {
@@ -375,6 +377,7 @@ export class HaAreaPicker extends LitElement {
.getItems=${this._getItems} .getItems=${this._getItems}
.getAdditionalItems=${this._getAdditionalItems} .getAdditionalItems=${this._getAdditionalItems}
.valueRenderer=${valueRenderer} .valueRenderer=${valueRenderer}
.addButtonLabel=${this.addButtonLabel}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
> >
</ha-generic-picker> </ha-generic-picker>

View File

@@ -59,6 +59,7 @@ export class HaButton extends Button {
line-height: 1; line-height: 1;
transition: background-color 0.15s ease-in-out; transition: background-color 0.15s ease-in-out;
text-wrap: wrap;
} }
:host([size="small"]) .button { :host([size="small"]) .button {

View File

@@ -10,7 +10,6 @@ import type { HomeAssistant } from "../types";
import "./ha-bottom-sheet"; import "./ha-bottom-sheet";
import "./ha-button"; import "./ha-button";
import "./ha-combo-box-item"; import "./ha-combo-box-item";
import "./ha-icon-button";
import "./ha-input-helper-text"; import "./ha-input-helper-text";
import "./ha-picker-combo-box"; import "./ha-picker-combo-box";
import type { import type {

View File

@@ -1,6 +1,7 @@
import { mdiMenuDown } from "@mdi/js";
import type { PropertyValues } from "lit"; import type { PropertyValues } from "lit";
import { css, html, LitElement } from "lit"; import { css, html, LitElement, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import memoizeOne from "memoize-one"; import memoizeOne from "memoize-one";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
import { formatLanguageCode } from "../common/language/format_language"; import { formatLanguageCode } from "../common/language/format_language";
@@ -8,10 +9,10 @@ import { caseInsensitiveStringCompare } from "../common/string/compare";
import type { FrontendLocaleData } from "../data/translation"; import type { FrontendLocaleData } from "../data/translation";
import { translationMetadata } from "../resources/translations-metadata"; import { translationMetadata } from "../resources/translations-metadata";
import type { HomeAssistant, ValueChangedEvent } from "../types"; import type { HomeAssistant, ValueChangedEvent } from "../types";
import "./ha-button";
import "./ha-generic-picker"; import "./ha-generic-picker";
import "./ha-list-item"; import type { HaGenericPicker } from "./ha-generic-picker";
import type { PickerComboBoxItem } from "./ha-picker-combo-box"; import type { PickerComboBoxItem } from "./ha-picker-combo-box";
import "./ha-select";
export const getLanguageOptions = ( export const getLanguageOptions = (
languages: string[], languages: string[],
@@ -75,6 +76,9 @@ export class HaLanguagePicker extends LitElement {
@property({ attribute: "native-name", type: Boolean }) @property({ attribute: "native-name", type: Boolean })
public nativeName = false; public nativeName = false;
@property({ type: Boolean, attribute: "button-style" })
public buttonStyle = false;
@property({ attribute: "no-sort", type: Boolean }) public noSort = false; @property({ attribute: "no-sort", type: Boolean }) public noSort = false;
@property({ attribute: "inline-arrow", type: Boolean }) @property({ attribute: "inline-arrow", type: Boolean })
@@ -82,6 +86,8 @@ export class HaLanguagePicker extends LitElement {
@state() _defaultLanguages: string[] = []; @state() _defaultLanguages: string[] = [];
@query("ha-generic-picker", true) public genericPicker!: HaGenericPicker;
protected firstUpdated(changedProps: PropertyValues) { protected firstUpdated(changedProps: PropertyValues) {
super.firstUpdated(changedProps); super.firstUpdated(changedProps);
this._computeDefaultLanguageOptions(); this._computeDefaultLanguageOptions();
@@ -101,12 +107,13 @@ export class HaLanguagePicker extends LitElement {
this.hass?.locale this.hass?.locale
); );
private _valueRenderer = (value) => { private _getLanguageName = (lang?: string) =>
const language = this._getItems().find( this._getItems().find((language) => language.id === lang)?.primary;
(lang) => lang.id === value
)?.primary; private _valueRenderer = (value) =>
return html`<span slot="headline">${language ?? value}</span> `; html`<span slot="headline"
}; >${this._getLanguageName(value) ?? value}</span
> `;
protected render() { protected render() {
const value = const value =
@@ -130,10 +137,28 @@ export class HaLanguagePicker extends LitElement {
.getItems=${this._getItems} .getItems=${this._getItems}
@value-changed=${this._changed} @value-changed=${this._changed}
hide-clear-icon hide-clear-icon
></ha-generic-picker> >
${this.buttonStyle
? html`<ha-button
slot="field"
.disabled=${this.disabled}
@click=${this._openPicker}
appearance="plain"
variant="neutral"
>
${this._getLanguageName(value)}
<ha-svg-icon slot="end" .path=${mdiMenuDown}></ha-svg-icon>
</ha-button>`
: nothing}
</ha-generic-picker>
`; `;
} }
private _openPicker(ev: Event) {
ev.stopPropagation();
this.genericPicker.open();
}
static styles = css` static styles = css`
ha-generic-picker { ha-generic-picker {
width: 100%; width: 100%;

View File

@@ -1,7 +1,8 @@
import { ListItemEl } from "@material/web/list/internal/listitem/list-item"; import { ListItemEl } from "@material/web/list/internal/listitem/list-item";
import { styles } from "@material/web/list/internal/listitem/list-item-styles"; import { styles } from "@material/web/list/internal/listitem/list-item-styles";
import { css } from "lit"; import { css, html, nothing, type TemplateResult } from "lit";
import { customElement } from "lit/decorators"; import { customElement } from "lit/decorators";
import "./ha-ripple";
export const haMdListStyles = [ export const haMdListStyles = [
styles, styles,
@@ -25,6 +26,18 @@ export const haMdListStyles = [
@customElement("ha-md-list-item") @customElement("ha-md-list-item")
export class HaMdListItem extends ListItemEl { export class HaMdListItem extends ListItemEl {
static override styles = haMdListStyles; static override styles = haMdListStyles;
protected renderRipple(): TemplateResult | typeof nothing {
if (this.type === "text") {
return nothing;
}
return html`<ha-ripple
part="ripple"
for="item"
?disabled=${this.disabled && this.type !== "link"}
></ha-ripple>`;
}
} }
declare global { declare global {

View File

@@ -87,166 +87,208 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
protected render() { protected render() {
if (this.addOnTop) { if (this.addOnTop) {
return html` ${this._renderChips()} ${this._renderItems()} `; return html` ${this._renderPicker()} ${this._renderItems()} `;
} }
return html` ${this._renderItems()} ${this._renderChips()} `; return html` ${this._renderItems()} ${this._renderPicker()} `;
} }
private _renderValueChips() { private _renderValueChips() {
return html`<div class="mdc-chip-set items"> const entityIds = this.value?.entity_id
${this.value?.floor_id ? ensureArray(this.value.entity_id)
? ensureArray(this.value.floor_id).map( : [];
(floor_id) => html` const deviceIds = this.value?.device_id
<ha-target-picker-value-chip ? ensureArray(this.value.device_id)
.hass=${this.hass} : [];
type="floor" const areaIds = this.value?.area_id ? ensureArray(this.value.area_id) : [];
.itemId=${floor_id} const floorIds = this.value?.floor_id
@remove-target-item=${this._handleRemove} ? ensureArray(this.value.floor_id)
@expand-target-item=${this._handleExpand} : [];
></ha-target-picker-value-chip> const labelIds = this.value?.label_id
` ? ensureArray(this.value.label_id)
) : [];
: nothing}
${this.value?.area_id
? ensureArray(this.value.area_id).map(
(area_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="area"
.itemId=${area_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
${this.value?.device_id
? ensureArray(this.value.device_id).map(
(device_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="device"
.itemId=${device_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
${this.value?.entity_id
? ensureArray(this.value.entity_id).map(
(entity_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="entity"
.itemId=${entity_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
${this.value?.label_id
? ensureArray(this.value.label_id).map(
(label_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="label"
.itemId=${label_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
</div>`;
}
private _renderValueGroups() {
return html`<div class="item-groups">
${this.value?.entity_id
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="entity"
.hass=${this.hass}
.items=${{ entity: ensureArray(this.value?.entity_id) }}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
${this.value?.device_id
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="device"
.hass=${this.hass}
.items=${{ device: ensureArray(this.value?.device_id) }}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
${this.value?.floor_id || this.value?.area_id
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="area"
.hass=${this.hass}
.items=${{
floor: ensureArray(this.value?.floor_id),
area: ensureArray(this.value?.area_id),
}}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
${this.value?.label_id
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="label"
.hass=${this.hass}
.items=${{ label: ensureArray(this.value?.label_id) }}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
</div>`;
}
private _renderItems() {
if ( if (
!this.value?.floor_id && !entityIds.length &&
!this.value?.area_id && !deviceIds.length &&
!this.value?.device_id && !areaIds.length &&
!this.value?.entity_id && !floorIds.length &&
!this.value?.label_id !labelIds.length
) { ) {
return nothing; return nothing;
} }
return html`
<div class="mdc-chip-set items">
${floorIds.length
? floorIds.map(
(floor_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="floor"
.itemId=${floor_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
${areaIds.length
? areaIds.map(
(area_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="area"
.itemId=${area_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
${deviceIds.length
? deviceIds.map(
(device_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="device"
.itemId=${device_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
${entityIds.length
? entityIds.map(
(entity_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="entity"
.itemId=${entity_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
${labelIds.length
? labelIds.map(
(label_id) => html`
<ha-target-picker-value-chip
.hass=${this.hass}
type="label"
.itemId=${label_id}
@remove-target-item=${this._handleRemove}
@expand-target-item=${this._handleExpand}
></ha-target-picker-value-chip>
`
)
: nothing}
</div>
`;
}
private _renderValueGroups() {
const entityIds = this.value?.entity_id
? ensureArray(this.value.entity_id)
: [];
const deviceIds = this.value?.device_id
? ensureArray(this.value.device_id)
: [];
const areaIds = this.value?.area_id ? ensureArray(this.value.area_id) : [];
const floorIds = this.value?.floor_id
? ensureArray(this.value.floor_id)
: [];
const labelIds = this.value?.label_id
? ensureArray(this.value?.label_id)
: [];
if (
!entityIds.length &&
!deviceIds.length &&
!areaIds.length &&
!floorIds.length &&
!labelIds.length
) {
return nothing;
}
return html`
<div class="item-groups">
${entityIds.length
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="entity"
.hass=${this.hass}
.items=${{ entity: entityIds }}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
${deviceIds.length
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="device"
.hass=${this.hass}
.items=${{ device: deviceIds }}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
${floorIds.length || areaIds.length
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="area"
.hass=${this.hass}
.items=${{
floor: floorIds,
area: areaIds,
}}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
${labelIds.length
? html`
<ha-target-picker-item-group
@remove-target-item=${this._handleRemove}
type="label"
.hass=${this.hass}
.items=${{ label: labelIds }}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDomains=${this.includeDomains}
.includeDeviceClasses=${this.includeDeviceClasses}
>
</ha-target-picker-item-group>
`
: nothing}
</div>
`;
}
private _renderItems() {
return html` return html`
${this.compact ? this._renderValueChips() : this._renderValueGroups()} ${this.compact ? this._renderValueChips() : this._renderValueGroups()}
`; `;
} }
private _renderChips() { private _renderPicker() {
return html` return html`
<div class="add-target-wrapper"> <div class="add-target-wrapper">
<ha-button <ha-button
@@ -347,7 +389,8 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
this._pickerFilter = filter; this._pickerFilter = filter;
}; };
private _hidePicker() { private _hidePicker(ev) {
ev.stopPropagation();
this._open = false; this._open = false;
this._pickerWrapperOpen = false; this._pickerWrapperOpen = false;

View File

@@ -9,7 +9,7 @@ export class HaTooltip extends Tooltip {
@property({ attribute: "show-delay", type: Number }) showDelay = 150; @property({ attribute: "show-delay", type: Number }) showDelay = 150;
/** The amount of time to wait before hiding the tooltip when the user mouses out.. */ /** The amount of time to wait before hiding the tooltip when the user mouses out.. */
@property({ attribute: "hide-delay", type: Number }) hideDelay = 400; @property({ attribute: "hide-delay", type: Number }) hideDelay = 150;
static get styles(): CSSResultGroup { static get styles(): CSSResultGroup {
return [ return [

View File

@@ -6,6 +6,7 @@ import {
mdiLabel, mdiLabel,
mdiTextureBox, mdiTextureBox,
} from "@mdi/js"; } from "@mdi/js";
import type { HassEntity } from "home-assistant-js-websocket";
import { css, html, LitElement, nothing, type PropertyValues } from "lit"; import { css, html, LitElement, nothing, type PropertyValues } from "lit";
import { customElement, property, query, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import memoizeOne from "memoize-one"; import memoizeOne from "memoize-one";
@@ -19,9 +20,12 @@ import { computeDomain } from "../../common/entity/compute_domain";
import { computeEntityName } from "../../common/entity/compute_entity_name"; import { computeEntityName } from "../../common/entity/compute_entity_name";
import { getEntityContext } from "../../common/entity/context/get_entity_context"; import { getEntityContext } from "../../common/entity/context/get_entity_context";
import { computeRTL } from "../../common/util/compute_rtl"; import { computeRTL } from "../../common/util/compute_rtl";
import type { AreaRegistryEntry } from "../../data/area_registry";
import { getConfigEntry } from "../../data/config_entries"; import { getConfigEntry } from "../../data/config_entries";
import { labelsContext } from "../../data/context"; import { labelsContext } from "../../data/context";
import type { DeviceRegistryEntry } from "../../data/device_registry";
import type { HaEntityPickerEntityFilterFunc } from "../../data/entity"; import type { HaEntityPickerEntityFilterFunc } from "../../data/entity";
import type { FloorRegistryEntry } from "../../data/floor_registry";
import { domainToName } from "../../data/integration"; import { domainToName } from "../../data/integration";
import type { LabelRegistryEntry } from "../../data/label_registry"; import type { LabelRegistryEntry } from "../../data/label_registry";
import { import {
@@ -111,10 +115,10 @@ export class HaTargetPickerItemRow extends LitElement {
} }
protected render() { protected render() {
const { name, context, iconPath, fallbackIconPath, stateObject } = const { name, context, iconPath, fallbackIconPath, stateObject, notFound } =
this._itemData(this.type, this.itemId); this._itemData(this.type, this.itemId);
const showEntities = this.type !== "entity"; const showEntities = this.type !== "entity" && !notFound;
const entries = this.parentEntries || this._entries; const entries = this.parentEntries || this._entries;
@@ -128,7 +132,7 @@ export class HaTargetPickerItemRow extends LitElement {
} }
return html` return html`
<ha-md-list-item type="text"> <ha-md-list-item type="text" class=${notFound ? "error" : ""}>
<div class="icon" slot="start"> <div class="icon" slot="start">
${this.subEntry ${this.subEntry
? html` ? html`
@@ -148,11 +152,15 @@ export class HaTargetPickerItemRow extends LitElement {
/>` />`
: fallbackIconPath : fallbackIconPath
? html`<ha-svg-icon .path=${fallbackIconPath}></ha-svg-icon>` ? html`<ha-svg-icon .path=${fallbackIconPath}></ha-svg-icon>`
: stateObject : this.type === "entity"
? html` ? html`
<ha-state-icon <ha-state-icon
.hass=${this.hass} .hass=${this.hass}
.stateObj=${stateObject} .stateObj=${stateObject ||
({
entity_id: this.itemId,
attributes: {},
} as HassEntity)}
> >
</ha-state-icon> </ha-state-icon>
` `
@@ -160,8 +168,14 @@ export class HaTargetPickerItemRow extends LitElement {
</div> </div>
<div slot="headline">${name}</div> <div slot="headline">${name}</div>
${context && !this.hideContext ${notFound || (context && !this.hideContext)
? html`<span slot="supporting-text">${context}</span>` ? html`<span slot="supporting-text"
>${notFound
? this.hass.localize(
`ui.components.target-picker.${this.type}_not_found`
)
: context}</span
>`
: nothing} : nothing}
${this._domainName && this.subEntry ${this._domainName && this.subEntry
? html`<span slot="supporting-text" class="domain" ? html`<span slot="supporting-text" class="domain"
@@ -474,26 +488,28 @@ export class HaTargetPickerItemRow extends LitElement {
private _itemData = memoizeOne((type: TargetType, item: string) => { private _itemData = memoizeOne((type: TargetType, item: string) => {
if (type === "floor") { if (type === "floor") {
const floor = this.hass.floors?.[item]; const floor: FloorRegistryEntry | undefined = this.hass.floors?.[item];
return { return {
name: floor?.name || item, name: floor?.name || item,
iconPath: floor?.icon, iconPath: floor?.icon,
fallbackIconPath: floor ? floorDefaultIconPath(floor) : mdiHome, fallbackIconPath: floor ? floorDefaultIconPath(floor) : mdiHome,
notFound: !floor,
}; };
} }
if (type === "area") { if (type === "area") {
const area = this.hass.areas?.[item]; const area: AreaRegistryEntry | undefined = this.hass.areas?.[item];
return { return {
name: area?.name || item, name: area?.name || item,
context: area.floor_id && this.hass.floors?.[area.floor_id]?.name, context: area?.floor_id && this.hass.floors?.[area.floor_id]?.name,
iconPath: area?.icon, iconPath: area?.icon,
fallbackIconPath: mdiTextureBox, fallbackIconPath: mdiTextureBox,
notFound: !area,
}; };
} }
if (type === "device") { if (type === "device") {
const device = this.hass.devices?.[item]; const device: DeviceRegistryEntry | undefined = this.hass.devices?.[item];
if (device.primary_config_entry) { if (device?.primary_config_entry) {
this._getDeviceDomain(device.primary_config_entry); this._getDeviceDomain(device.primary_config_entry);
} }
@@ -501,24 +517,25 @@ export class HaTargetPickerItemRow extends LitElement {
name: device ? computeDeviceNameDisplay(device, this.hass) : item, name: device ? computeDeviceNameDisplay(device, this.hass) : item,
context: device?.area_id && this.hass.areas?.[device.area_id]?.name, context: device?.area_id && this.hass.areas?.[device.area_id]?.name,
fallbackIconPath: mdiDevices, fallbackIconPath: mdiDevices,
notFound: !device,
}; };
} }
if (type === "entity") { if (type === "entity") {
this._setDomainName(computeDomain(item)); this._setDomainName(computeDomain(item));
const stateObject = this.hass.states[item]; const stateObject: HassEntity | undefined = this.hass.states[item];
const entityName = computeEntityName( const entityName = stateObject
stateObject, ? computeEntityName(stateObject, this.hass.entities, this.hass.devices)
this.hass.entities, : item;
this.hass.devices const { area, device } = stateObject
); ? getEntityContext(
const { area, device } = getEntityContext( stateObject,
stateObject, this.hass.entities,
this.hass.entities, this.hass.devices,
this.hass.devices, this.hass.areas,
this.hass.areas, this.hass.floors
this.hass.floors )
); : { area: undefined, device: undefined };
const deviceName = device ? computeDeviceName(device) : undefined; const deviceName = device ? computeDeviceName(device) : undefined;
const areaName = area ? computeAreaName(area) : undefined; const areaName = area ? computeAreaName(area) : undefined;
const context = [areaName, entityName ? deviceName : undefined] const context = [areaName, entityName ? deviceName : undefined]
@@ -528,15 +545,19 @@ export class HaTargetPickerItemRow extends LitElement {
name: entityName || deviceName || item, name: entityName || deviceName || item,
context, context,
stateObject, stateObject,
notFound: !stateObject && item !== "all" && item !== "none",
}; };
} }
// type label // type label
const label = this._labelRegistry.find((lab) => lab.label_id === item); const label: LabelRegistryEntry | undefined = this._labelRegistry.find(
(lab) => lab.label_id === item
);
return { return {
name: label?.name || item, name: label?.name || item,
iconPath: label?.icon, iconPath: label?.icon,
fallbackIconPath: mdiLabel, fallbackIconPath: mdiLabel,
notFound: !label,
}; };
}); });
@@ -597,17 +618,27 @@ export class HaTargetPickerItemRow extends LitElement {
border-radius: var(--ha-card-border-radius, var(--ha-border-radius-lg)); border-radius: var(--ha-card-border-radius, var(--ha-border-radius-lg));
} }
.error {
background: var(--ha-color-fill-warning-quiet-resting);
}
.error [slot="supporting-text"] {
color: var(--ha-color-on-warning-normal);
}
state-badge { state-badge {
color: var(--ha-color-on-neutral-quiet); color: var(--ha-color-on-neutral-quiet);
} }
.icon { .icon {
width: 24px;
display: flex; display: flex;
} }
img { img {
width: 24px; width: 24px;
height: 24px; height: 24px;
z-index: 1;
} }
ha-icon-button { ha-icon-button {
--mdc-icon-button-size: 32px; --mdc-icon-button-size: 32px;

View File

@@ -705,7 +705,7 @@ export class HaTargetPickerSelector extends LitElement {
) as EntityComboBoxItem[]; ) as EntityComboBoxItem[];
} }
if (!filterType) { if (!filterType && entities.length) {
// show group title // show group title
items.push( items.push(
this.hass.localize("ui.components.target-picker.type.entities") this.hass.localize("ui.components.target-picker.type.entities")
@@ -733,7 +733,7 @@ export class HaTargetPickerSelector extends LitElement {
devices = this._filterGroup("device", devices); devices = this._filterGroup("device", devices);
} }
if (!filterType) { if (!filterType && devices.length) {
// show group title // show group title
items.push( items.push(
this.hass.localize("ui.components.target-picker.type.devices") this.hass.localize("ui.components.target-picker.type.devices")
@@ -769,7 +769,7 @@ export class HaTargetPickerSelector extends LitElement {
) as FloorComboBoxItem[]; ) as FloorComboBoxItem[];
} }
if (!filterType) { if (!filterType && areasAndFloors.length) {
// show group title // show group title
items.push( items.push(
this.hass.localize("ui.components.target-picker.type.areas") this.hass.localize("ui.components.target-picker.type.areas")
@@ -811,7 +811,7 @@ export class HaTargetPickerSelector extends LitElement {
labels = this._filterGroup("label", labels); labels = this._filterGroup("label", labels);
} }
if (!filterType) { if (!filterType && labels.length) {
// show group title // show group title
items.push( items.push(
this.hass.localize("ui.components.target-picker.type.labels") this.hass.localize("ui.components.target-picker.type.labels")

View File

@@ -1,3 +1,5 @@
import { isComponentLoaded } from "../common/config/is_component_loaded";
import { atLeastVersion } from "../common/config/version";
import type { HomeAssistant } from "../types"; import type { HomeAssistant } from "../types";
export interface LogProvider { export interface LogProvider {
@@ -8,4 +10,8 @@ export interface LogProvider {
export const fetchErrorLog = (hass: HomeAssistant) => export const fetchErrorLog = (hass: HomeAssistant) =>
hass.callApi<string>("GET", "error_log"); hass.callApi<string>("GET", "error_log");
export const getErrorLogDownloadUrl = "/api/error_log"; export const getErrorLogDownloadUrl = (hass: HomeAssistant) =>
isComponentLoaded(hass, "hassio") &&
atLeastVersion(hass.config.version, 2025, 10)
? "/api/hassio/core/logs/latest"
: "/api/error_log";

View File

@@ -12,6 +12,7 @@ import {
mdiChatSleep, mdiChatSleep,
mdiClipboardList, mdiClipboardList,
mdiClock, mdiClock,
mdiCodeBraces,
mdiCog, mdiCog,
mdiCommentAlert, mdiCommentAlert,
mdiCounter, mdiCounter,
@@ -113,6 +114,7 @@ export const FALLBACK_DOMAIN_ICONS = {
text: mdiFormTextbox, text: mdiFormTextbox,
time: mdiClock, time: mdiClock,
timer: mdiTimerOutline, timer: mdiTimerOutline,
template: mdiCodeBraces,
todo: mdiClipboardList, todo: mdiClipboardList,
tts: mdiSpeakerMessage, tts: mdiSpeakerMessage,
vacuum: mdiRobotVacuum, vacuum: mdiRobotVacuum,

View File

@@ -97,6 +97,9 @@ export const ENTITY_COMPONENT_ICONS: Record<string, ComponentIcons> = {
pm25: { pm25: {
default: "mdi:molecule", default: "mdi:molecule",
}, },
pm4: {
default: "mdi:molecule",
},
power: { power: {
default: "mdi:flash", default: "mdi:flash",
}, },
@@ -674,6 +677,9 @@ export const ENTITY_COMPONENT_ICONS: Record<string, ComponentIcons> = {
pm25: { pm25: {
default: "mdi:molecule", default: "mdi:molecule",
}, },
pm4: {
default: "mdi:molecule",
},
power: { power: {
default: "mdi:flash", default: "mdi:flash",
}, },

View File

@@ -33,7 +33,7 @@ const COMPONENTS = {
"media-browser": () => "media-browser": () =>
import("../panels/media-browser/ha-panel-media-browser"), import("../panels/media-browser/ha-panel-media-browser"),
light: () => import("../panels/light/ha-panel-light"), light: () => import("../panels/light/ha-panel-light"),
safety: () => import("../panels/safety/ha-panel-safety"), security: () => import("../panels/security/ha-panel-security"),
climate: () => import("../panels/climate/ha-panel-climate"), climate: () => import("../panels/climate/ha-panel-climate"),
}; };

View File

@@ -1,24 +1,23 @@
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit"; import type { CSSResultGroup, PropertyValues } from "lit";
import { LitElement, css, html } from "lit"; import { LitElement, css, html, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { goBack } from "../../common/navigate"; import { goBack } from "../../common/navigate";
import { debounce } from "../../common/util/debounce";
import { deepEqual } from "../../common/util/deep-equal";
import "../../components/ha-icon-button-arrow-prev"; import "../../components/ha-icon-button-arrow-prev";
import "../../components/ha-menu-button"; import "../../components/ha-menu-button";
import type { LovelaceConfig } from "../../data/lovelace/config/types"; import type { LovelaceStrategyViewConfig } from "../../data/lovelace/config/view";
import { haStyle } from "../../resources/styles"; import { haStyle } from "../../resources/styles";
import type { HomeAssistant } from "../../types"; import type { HomeAssistant } from "../../types";
import { generateLovelaceViewStrategy } from "../lovelace/strategies/get-strategy";
import type { Lovelace } from "../lovelace/types"; import type { Lovelace } from "../lovelace/types";
import "../lovelace/views/hui-view"; import "../lovelace/views/hui-view";
import "../lovelace/views/hui-view-container"; import "../lovelace/views/hui-view-container";
const CLIMATE_LOVELACE_CONFIG: LovelaceConfig = { const CLIMATE_LOVELACE_VIEW_CONFIG: LovelaceStrategyViewConfig = {
views: [ strategy: {
{ type: "climate",
strategy: { },
type: "climate",
},
},
],
}; };
@customElement("ha-panel-climate") @customElement("ha-panel-climate")
@@ -33,65 +32,119 @@ class PanelClimate extends LitElement {
@state() private _searchParms = new URLSearchParams(window.location.search); @state() private _searchParms = new URLSearchParams(window.location.search);
public firstUpdated(_changedProperties: PropertyValues): void {
super.firstUpdated(_changedProperties);
}
public willUpdate(changedProps: PropertyValues) { public willUpdate(changedProps: PropertyValues) {
super.willUpdate(changedProps);
// Initial setup
if (!this.hasUpdated) { if (!this.hasUpdated) {
this.hass.loadFragmentTranslation("lovelace"); this.hass.loadFragmentTranslation("lovelace");
this._setLovelace();
return;
} }
if (!changedProps.has("hass")) { if (!changedProps.has("hass")) {
return; return;
} }
const oldHass = changedProps.get("hass") as this["hass"]; const oldHass = changedProps.get("hass") as this["hass"];
if (oldHass?.locale !== this.hass.locale) { if (oldHass && oldHass.localize !== this.hass.localize) {
this._setLovelace(); this._setLovelace();
return;
}
if (oldHass && this.hass) {
// If the entity registry changed, ask the user if they want to refresh the config
if (
oldHass.entities !== this.hass.entities ||
oldHass.devices !== this.hass.devices ||
oldHass.areas !== this.hass.areas ||
oldHass.floors !== this.hass.floors
) {
if (this.hass.config.state === "RUNNING") {
this._debounceRegistriesChanged();
return;
}
}
// If ha started, refresh the config
if (
this.hass.config.state === "RUNNING" &&
oldHass.config.state !== "RUNNING"
) {
this._setLovelace();
}
} }
} }
private _debounceRegistriesChanged = debounce(
() => this._registriesChanged(),
200
);
private _registriesChanged = async () => {
this._setLovelace();
};
private _back(ev) { private _back(ev) {
ev.stopPropagation(); ev.stopPropagation();
goBack(); goBack();
} }
protected render(): TemplateResult { protected render() {
return html` return html`
<div class="header"> <div class="header">
<div class="toolbar"> <div class="toolbar">
${this._searchParms.has("historyBack") ${
? html` this._searchParms.has("historyBack")
<ha-icon-button-arrow-prev ? html`
@click=${this._back} <ha-icon-button-arrow-prev
slot="navigationIcon" @click=${this._back}
></ha-icon-button-arrow-prev> slot="navigationIcon"
` ></ha-icon-button-arrow-prev>
: html` `
<ha-menu-button : html`
slot="navigationIcon" <ha-menu-button
.hass=${this.hass} slot="navigationIcon"
.narrow=${this.narrow} .hass=${this.hass}
></ha-menu-button> .narrow=${this.narrow}
`} ></ha-menu-button>
`
}
<div class="main-title">${this.hass.localize("panel.climate")}</div> <div class="main-title">${this.hass.localize("panel.climate")}</div>
</div> </div>
</div> </div>
${
<hui-view-container .hass=${this.hass}> this._lovelace
<hui-view ? html`
.hass=${this.hass} <hui-view-container .hass=${this.hass}>
.narrow=${this.narrow} <hui-view
.lovelace=${this._lovelace} .hass=${this.hass}
.index=${this._viewIndex} .narrow=${this.narrow}
></hui-view> .lovelace=${this._lovelace}
.index=${this._viewIndex}
></hui-view
></hui-view-container>
`
: nothing
}
</hui-view-container> </hui-view-container>
`; `;
} }
private _setLovelace() { private async _setLovelace() {
const viewConfig = await generateLovelaceViewStrategy(
CLIMATE_LOVELACE_VIEW_CONFIG,
this.hass
);
const config = { views: [viewConfig] };
const rawConfig = { views: [CLIMATE_LOVELACE_VIEW_CONFIG] };
if (deepEqual(config, this._lovelace?.config)) {
return;
}
this._lovelace = { this._lovelace = {
config: CLIMATE_LOVELACE_CONFIG, config: config,
rawConfig: CLIMATE_LOVELACE_CONFIG, rawConfig: rawConfig,
editMode: false, editMode: false,
urlPath: "climate", urlPath: "climate",
mode: "generated", mode: "generated",

View File

@@ -115,6 +115,24 @@ const processAreasForClimate = (
return cards; return cards;
}; };
const processUnassignedEntities = (
hass: HomeAssistant,
entities: string[]
): LovelaceCardConfig[] => {
const unassignedFilter = generateEntityFilter(hass, {
area: null,
});
const unassignedEntities = entities.filter(unassignedFilter);
const areaCards: LovelaceCardConfig[] = [];
const computeTileCard = computeAreaTileCardConfig(hass, "", true);
for (const entityId of unassignedEntities) {
areaCards.push(computeTileCard(entityId));
}
return areaCards;
};
@customElement("climate-view-strategy") @customElement("climate-view-strategy")
export class ClimateViewStrategy extends ReactiveElement { export class ClimateViewStrategy extends ReactiveElement {
static async generate( static async generate(
@@ -190,10 +208,33 @@ export class ClimateViewStrategy extends ReactiveElement {
} }
} }
// Process unassigned entities
const unassignedCards = processUnassignedEntities(hass, entities);
if (unassignedCards.length > 0) {
const section: LovelaceSectionRawConfig = {
type: "grid",
column_span: 2,
cards: [
{
type: "heading",
heading:
sections.length > 0
? hass.localize(
"ui.panel.lovelace.strategy.climate.other_devices"
)
: hass.localize("ui.panel.lovelace.strategy.climate.devices"),
},
...unassignedCards,
],
};
sections.push(section);
}
return { return {
type: "sections", type: "sections",
max_columns: 2, max_columns: 2,
sections: sections || [], sections: sections,
}; };
} }
} }

View File

@@ -8,24 +8,24 @@ import { fireEvent } from "../../../common/dom/fire_event";
import "../../../components/chips/ha-chip-set"; import "../../../components/chips/ha-chip-set";
import "../../../components/chips/ha-input-chip"; import "../../../components/chips/ha-input-chip";
import "../../../components/ha-alert"; import "../../../components/ha-alert";
import "../../../components/ha-button";
import "../../../components/ha-aliases-editor"; import "../../../components/ha-aliases-editor";
import "../../../components/ha-area-picker";
import "../../../components/ha-button";
import { createCloseHeading } from "../../../components/ha-dialog"; import { createCloseHeading } from "../../../components/ha-dialog";
import "../../../components/ha-icon-picker"; import "../../../components/ha-icon-picker";
import "../../../components/ha-picture-upload"; import "../../../components/ha-picture-upload";
import "../../../components/ha-settings-row"; import "../../../components/ha-settings-row";
import "../../../components/ha-svg-icon"; import "../../../components/ha-svg-icon";
import "../../../components/ha-textfield"; import "../../../components/ha-textfield";
import "../../../components/ha-area-picker"; import { updateAreaRegistryEntry } from "../../../data/area_registry";
import type { import type {
FloorRegistryEntry, FloorRegistryEntry,
FloorRegistryEntryMutableParams, FloorRegistryEntryMutableParams,
} from "../../../data/floor_registry"; } from "../../../data/floor_registry";
import { haStyle, haStyleDialog } from "../../../resources/styles"; import { haStyle, haStyleDialog } from "../../../resources/styles";
import type { HomeAssistant } from "../../../types"; import type { HomeAssistant } from "../../../types";
import type { FloorRegistryDetailDialogParams } from "./show-dialog-floor-registry-detail";
import { showAreaRegistryDetailDialog } from "./show-dialog-area-registry-detail"; import { showAreaRegistryDetailDialog } from "./show-dialog-area-registry-detail";
import { updateAreaRegistryEntry } from "../../../data/area_registry"; import type { FloorRegistryDetailDialogParams } from "./show-dialog-floor-registry-detail";
class DialogFloorDetail extends LitElement { class DialogFloorDetail extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@@ -168,11 +168,6 @@ class DialogFloorDetail extends LitElement {
)} )}
</h3> </h3>
<p class="description">
${this.hass.localize(
"ui.panel.config.floors.editor.areas_description"
)}
</p>
${areas.length ${areas.length
? html`<ha-chip-set> ? html`<ha-chip-set>
${repeat( ${repeat(
@@ -197,13 +192,17 @@ class DialogFloorDetail extends LitElement {
</ha-input-chip>` </ha-input-chip>`
)} )}
</ha-chip-set>` </ha-chip-set>`
: nothing} : html`<p class="description">
${this.hass.localize(
"ui.panel.config.floors.editor.areas_description"
)}
</p>`}
<ha-area-picker <ha-area-picker
no-add no-add
.hass=${this.hass} .hass=${this.hass}
@value-changed=${this._addArea} @value-changed=${this._addArea}
.excludeAreas=${areas.map((a) => a.area_id)} .excludeAreas=${areas.map((a) => a.area_id)}
.label=${this.hass.localize( .addButtonLabel=${this.hass.localize(
"ui.panel.config.floors.editor.add_area" "ui.panel.config.floors.editor.add_area"
)} )}
></ha-area-picker> ></ha-area-picker>

View File

@@ -257,7 +257,7 @@ class DialogAddAutomationElement
const results = fuse.multiTermsSearch(filter); const results = fuse.multiTermsSearch(filter);
if (results) { if (results) {
return results.map((result) => result.item); return results.map((result) => result.item).filter((item) => item.name);
} }
return items; return items;
} }
@@ -294,7 +294,7 @@ class DialogAddAutomationElement
const results = fuse.multiTermsSearch(filter); const results = fuse.multiTermsSearch(filter);
if (results) { if (results) {
return results.map((result) => result.item); return results.map((result) => result.item).filter((item) => item.name);
} }
return items; return items;
} }
@@ -383,9 +383,16 @@ class DialogAddAutomationElement
generatedCollections.push({ generatedCollections.push({
titleKey: collection.titleKey, titleKey: collection.titleKey,
groups: groups.sort((a, b) => groups: groups.sort((a, b) => {
stringCompare(a.name, b.name, this.hass.locale.language) // make sure device is always on top
), if (a.key === "device" || a.key === "device_id") {
return -1;
}
if (b.key === "device" || b.key === "device_id") {
return 1;
}
return stringCompare(a.name, b.name, this.hass.locale.language);
}),
}); });
}); });
return generatedCollections; return generatedCollections;
@@ -678,7 +685,7 @@ class DialogAddAutomationElement
); );
const typeTitle = this.hass.localize( const typeTitle = this.hass.localize(
`ui.panel.config.automation.editor.${automationElementType}s.header` `ui.panel.config.automation.editor.${automationElementType}s.add`
); );
const tabButtons = [ const tabButtons = [
@@ -895,7 +902,9 @@ class DialogAddAutomationElement
return html` return html`
<div class="items-title ${this._itemsScrolled ? "scrolled" : ""}"> <div class="items-title ${this._itemsScrolled ? "scrolled" : ""}">
${title} ${this._tab === "blocks" && !this._filter
? this.hass.localize("ui.panel.config.automation.editor.blocks")
: title}
</div> </div>
<ha-md-list <ha-md-list
dialogInitialFocus=${ifDefined(this._fullScreen ? "" : undefined)} dialogInitialFocus=${ifDefined(this._fullScreen ? "" : undefined)}
@@ -1045,6 +1054,7 @@ class DialogAddAutomationElement
private _onSearchFocus(ev) { private _onSearchFocus(ev) {
this._removeKeyboardShortcuts = tinykeys(ev.target, { this._removeKeyboardShortcuts = tinykeys(ev.target, {
ArrowDown: this._focusSearchList, ArrowDown: this._focusSearchList,
Enter: this._pickSingleItem,
}); });
} }
@@ -1061,6 +1071,39 @@ class DialogAddAutomationElement
this._itemsListFirstElement.focus(); this._itemsListFirstElement.focus();
}; };
private _pickSingleItem = (ev: KeyboardEvent) => {
if (!this._filter) {
return;
}
ev.preventDefault();
const automationElementType = this._params!.type;
const items = [
...this._getFilteredItems(
automationElementType,
this._filter,
this.hass.localize,
this.hass.services,
this._manifests
),
...(automationElementType !== "trigger"
? this._getFilteredBuildingBlocks(
automationElementType,
this._filter,
this.hass.localize
)
: []),
];
if (items.length !== 1) {
return;
}
this._params!.add(items[0].key);
this.closeDialog();
};
static get styles(): CSSResultGroup { static get styles(): CSSResultGroup {
return [ return [
css` css`
@@ -1137,11 +1180,11 @@ class DialogAddAutomationElement
} }
.groups .selected { .groups .selected {
background-color: var(--ha-color-fill-primary-normal-active); background-color: var(--ha-color-fill-primary-normal-active);
--md-list-item-label-text-color: var(--primary-color); --md-list-item-label-text-color: var(--ha-color-on-primary-normal);
--icon-primary-color: var(--primary-color); --icon-primary-color: var(--ha-color-on-primary-normal);
} }
.groups .selected ha-svg-icon { .groups .selected ha-svg-icon {
color: var(--primary-color); color: var(--ha-color-on-primary-normal);
} }
.collection-title { .collection-title {

View File

@@ -125,8 +125,6 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
@query("#overflow-menu") private _overflowMenu?: HaMdMenu; @query("#overflow-menu") private _overflowMenu?: HaMdMenu;
private _overflowBackup?: BackupContent;
public connectedCallback() { public connectedCallback() {
super.connectedCallback(); super.connectedCallback();
window.addEventListener("location-changed", this._locationChanged); window.addEventListener("location-changed", this._locationChanged);
@@ -262,7 +260,7 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
type: "overflow-menu", type: "overflow-menu",
template: (backup) => html` template: (backup) => html`
<ha-icon-button <ha-icon-button
.selected=${backup} .backup=${backup}
.label=${this.hass.localize("ui.common.overflow_menu")} .label=${this.hass.localize("ui.common.overflow_menu")}
.path=${mdiDotsVertical} .path=${mdiDotsVertical}
@click=${this._toggleOverflowMenu} @click=${this._toggleOverflowMenu}
@@ -294,7 +292,6 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
this._overflowMenu.close(); this._overflowMenu.close();
return; return;
} }
this._overflowBackup = ev.target.selected;
this._overflowMenu.anchorElement = ev.target; this._overflowMenu.anchorElement = ev.target;
this._overflowMenu.show(); this._overflowMenu.show();
}; };
@@ -375,16 +372,14 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
clickable clickable
id="backup_id" id="backup_id"
has-filters has-filters
.filters=${ .filters=${Object.values(this._filters).filter((filter) =>
Object.values(this._filters).filter((filter) => Array.isArray(filter)
Array.isArray(filter) ? filter.length
? filter.length : filter &&
: filter && Object.values(filter).some((val) =>
Object.values(filter).some((val) => Array.isArray(val) ? val.length : val
Array.isArray(val) ? val.length : val )
) ).length}
).length
}
selectable selectable
.selected=${this._selected.length} .selected=${this._selected.length}
.initialGroupColumn=${this._activeGrouping} .initialGroupColumn=${this._activeGrouping}
@@ -426,30 +421,28 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
</div> </div>
<div slot="selection-bar"> <div slot="selection-bar">
${ ${!this.narrow
!this.narrow ? html`
? html` <ha-button
<ha-button appearance="plain"
appearance="plain" @click=${this._deleteSelected}
@click=${this._deleteSelected} variant="danger"
variant="danger" >
> ${this.hass.localize(
${this.hass.localize( "ui.panel.config.backup.backups.delete_selected"
"ui.panel.config.backup.backups.delete_selected" )}
)} </ha-button>
</ha-button> `
` : html`
: html` <ha-icon-button
<ha-icon-button .label=${this.hass.localize(
.label=${this.hass.localize( "ui.panel.config.backup.backups.delete_selected"
"ui.panel.config.backup.backups.delete_selected" )}
)} .path=${mdiDelete}
.path=${mdiDelete} class="warning"
class="warning" @click=${this._deleteSelected}
@click=${this._deleteSelected} ></ha-icon-button>
></ha-icon-button> `}
`
}
</div> </div>
<ha-filter-states <ha-filter-states
@@ -462,43 +455,39 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
expanded expanded
.narrow=${this.narrow} .narrow=${this.narrow}
></ha-filter-states> ></ha-filter-states>
${ ${!this._needsOnboarding
!this._needsOnboarding ? html`
? html` <ha-fab
<ha-fab slot="fab"
slot="fab" ?disabled=${backupInProgress}
?disabled=${backupInProgress} .label=${this.hass.localize(
.label=${this.hass.localize( "ui.panel.config.backup.backups.new_backup"
"ui.panel.config.backup.backups.new_backup" )}
)} extended
extended @click=${this._newBackup}
@click=${this._newBackup} >
> ${backupInProgress
${backupInProgress ? html`<div slot="icon" class="loading">
? html`<div slot="icon" class="loading"> <ha-spinner .size=${"small"}></ha-spinner>
<ha-spinner .size=${"small"}></ha-spinner> </div>`
</div>` : html`<ha-svg-icon
: html`<ha-svg-icon slot="icon"
slot="icon" .path=${mdiPlus}
.path=${mdiPlus} ></ha-svg-icon>`}
></ha-svg-icon>`} </ha-fab>
</ha-fab> `
` : nothing}
: nothing
}
</hass-tabs-subpage-data-table> </hass-tabs-subpage-data-table>
<ha-md-menu id="overflow-menu" positioning="fixed"> <ha-md-menu id="overflow-menu" positioning="fixed">
<ha-md-menu-item .clickAction=${this._downloadBackup}> <ha-md-menu-item .clickAction=${this._downloadBackup}>
<ha-svg-icon slot="start" .path=${mdiDownload}></ha-svg-icon> <ha-svg-icon slot="start" .path=${mdiDownload}></ha-svg-icon>
${this.hass.localize("ui.common.download")} ${this.hass.localize("ui.common.download")}
</ha-md-menu-item> </ha-md-menu-item>
<ha-md-menu-item class="warning" .clickAction=${this._deleteBackup}> <ha-md-menu-item class="warning" .clickAction=${this._deleteBackup}>
<ha-svg-icon slot="start" .path=${mdiDelete}></ha-svg-icon> <ha-svg-icon slot="start" .path=${mdiDelete}></ha-svg-icon>
${this.hass.localize("ui.common.delete")} ${this.hass.localize("ui.common.delete")}
</ha-md-menu-item> </ha-md-menu-item>
</ha-md-menu> </ha-md-menu>
>
</ha-icon-overflow-menu>
`; `;
} }
@@ -572,15 +561,17 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
navigate(`/config/backup/details/${id}`); navigate(`/config/backup/details/${id}`);
} }
private async _downloadBackup(): Promise<void> { private _downloadBackup = async (ev): Promise<void> => {
if (!this._overflowBackup) { const backup = ev.parentElement.anchorElement.backup;
if (!backup) {
return; return;
} }
downloadBackup(this.hass, this, this._overflowBackup, this.config); downloadBackup(this.hass, this, backup, this.config);
} };
private async _deleteBackup(): Promise<void> { private _deleteBackup = async (ev): Promise<void> => {
if (!this._overflowBackup) { const backup = ev.parentElement.anchorElement.backup;
if (!backup) {
return; return;
} }
@@ -596,11 +587,9 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
} }
try { try {
await deleteBackup(this.hass, this._overflowBackup.backup_id); await deleteBackup(this.hass, backup.backup_id);
if (this._selected.includes(this._overflowBackup.backup_id)) { if (this._selected.includes(backup.backup_id)) {
this._selected = this._selected.filter( this._selected = this._selected.filter((id) => id !== backup.backup_id);
(id) => id !== this._overflowBackup!.backup_id
);
} }
} catch (err: any) { } catch (err: any) {
showAlertDialog(this, { showAlertDialog(this, {
@@ -612,7 +601,7 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
return; return;
} }
fireEvent(this, "ha-refresh-backup-info"); fireEvent(this, "ha-refresh-backup-info");
} };
private async _deleteSelected() { private async _deleteSelected() {
const confirm = await showConfirmationDialog(this, { const confirm = await showConfirmationDialog(this, {

View File

@@ -4,6 +4,7 @@ import { customElement, property, query, state } from "lit/decorators";
import { isComponentLoaded } from "../../../../../common/config/is_component_loaded"; import { isComponentLoaded } from "../../../../../common/config/is_component_loaded";
import { dynamicElement } from "../../../../../common/dom/dynamic-element-directive"; import { dynamicElement } from "../../../../../common/dom/dynamic-element-directive";
import { fireEvent } from "../../../../../common/dom/fire_event"; import { fireEvent } from "../../../../../common/dom/fire_event";
import "../../../../../components/ha-button";
import type { ExtEntityRegistryEntry } from "../../../../../data/entity_registry"; import type { ExtEntityRegistryEntry } from "../../../../../data/entity_registry";
import { removeEntityRegistryEntry } from "../../../../../data/entity_registry"; import { removeEntityRegistryEntry } from "../../../../../data/entity_registry";
import { HELPERS_CRUD } from "../../../../../data/helpers_crud"; import { HELPERS_CRUD } from "../../../../../data/helpers_crud";
@@ -22,7 +23,6 @@ import "../../../helpers/forms/ha-schedule-form";
import "../../../helpers/forms/ha-timer-form"; import "../../../helpers/forms/ha-timer-form";
import "../../../voice-assistants/entity-voice-settings"; import "../../../voice-assistants/entity-voice-settings";
import "../../entity-registry-settings-editor"; import "../../entity-registry-settings-editor";
import "../../../../../components/ha-button";
import type { EntityRegistrySettingsEditor } from "../../entity-registry-settings-editor"; import type { EntityRegistrySettingsEditor } from "../../entity-registry-settings-editor";
@customElement("entity-settings-helper-tab") @customElement("entity-settings-helper-tab")
@@ -72,22 +72,28 @@ export class EntitySettingsHelperTab extends LitElement {
${this._error ${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>` ? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""} : ""}
${this._item === null
? html`<ha-alert alert-type="info"
>${this.hass.localize(
"ui.dialogs.helper_settings.yaml_not_editable"
)}</ha-alert
>`
: nothing}
${!this._componentLoaded ${!this._componentLoaded
? this.hass.localize( ? this.hass.localize(
"ui.dialogs.helper_settings.platform_not_loaded", "ui.dialogs.helper_settings.platform_not_loaded",
{ platform: this.entry.platform } { platform: this.entry.platform }
) )
: this._item === null : html`
? this.hass.localize("ui.dialogs.helper_settings.yaml_not_editable") <span @value-changed=${this._valueChanged}>
: html` ${dynamicElement(`ha-${this.entry.platform}-form`, {
<span @value-changed=${this._valueChanged}> hass: this.hass,
${dynamicElement(`ha-${this.entry.platform}-form`, { item: this._item,
hass: this.hass, entry: this.entry,
item: this._item, disabled: this._item === null,
entry: this.entry, })}
})} </span>
</span> `}
`}
<entity-registry-settings-editor <entity-registry-settings-editor
.hass=${this.hass} .hass=${this.hass}
.entry=${this.entry} .entry=${this.entry}
@@ -122,6 +128,9 @@ export class EntitySettingsHelperTab extends LitElement {
} }
private _valueChanged(ev: CustomEvent): void { private _valueChanged(ev: CustomEvent): void {
if (this._item === null) {
return;
}
this._error = undefined; this._error = undefined;
this._item = ev.detail.value; this._item = ev.detail.value;
} }
@@ -195,6 +204,10 @@ export class EntitySettingsHelperTab extends LitElement {
display: block; display: block;
padding: 0 !important; padding: 0 !important;
} }
ha-alert {
display: block;
margin-bottom: var(--ha-space-4);
}
.form { .form {
padding: 20px 24px; padding: 20px 24px;
} }

View File

@@ -784,7 +784,7 @@ export class EntityRegistrySettingsEditor extends LitElement {
<ha-labels-picker <ha-labels-picker
.hass=${this.hass} .hass=${this.hass}
.value=${this._labels} .value=${this._labels}
.disabled=${this.disabled} .disabled=${!!this.disabled}
@value-changed=${this._labelsChanged} @value-changed=${this._labelsChanged}
></ha-labels-picker> ></ha-labels-picker>
${this._cameraPrefs ${this._cameraPrefs

View File

@@ -17,6 +17,8 @@ class HaCounterForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
private _item?: Partial<Counter>; private _item?: Partial<Counter>;
@state() private _name!: string; @state() private _name!: string;
@@ -82,6 +84,7 @@ class HaCounterForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -91,6 +94,7 @@ class HaCounterForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
<ha-textfield <ha-textfield
.value=${this._minimum} .value=${this._minimum}
@@ -100,6 +104,7 @@ class HaCounterForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.counter.minimum" "ui.dialogs.helper_settings.counter.minimum"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-textfield <ha-textfield
.value=${this._maximum} .value=${this._maximum}
@@ -109,6 +114,7 @@ class HaCounterForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.counter.maximum" "ui.dialogs.helper_settings.counter.maximum"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-textfield <ha-textfield
.value=${this._initial} .value=${this._initial}
@@ -118,6 +124,7 @@ class HaCounterForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.counter.initial" "ui.dialogs.helper_settings.counter.initial"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-expansion-panel <ha-expansion-panel
header=${this.hass.localize( header=${this.hass.localize(
@@ -133,12 +140,14 @@ class HaCounterForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.counter.step" "ui.dialogs.helper_settings.counter.step"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<div class="row"> <div class="row">
<ha-switch <ha-switch
.checked=${this._restore} .checked=${this._restore}
.configValue=${"restore"} .configValue=${"restore"}
@change=${this._valueChanged} @change=${this._valueChanged}
.disabled=${this.disabled}
> >
</ha-switch> </ha-switch>
<div> <div>

View File

@@ -14,6 +14,8 @@ class HaInputBooleanForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
private _item?: InputBoolean; private _item?: InputBoolean;
@state() private _name!: string; @state() private _name!: string;
@@ -59,6 +61,7 @@ class HaInputBooleanForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -68,6 +71,7 @@ class HaInputBooleanForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
</div> </div>
`; `;

View File

@@ -14,6 +14,8 @@ class HaInputButtonForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
@state() private _name!: string; @state() private _name!: string;
@state() private _icon!: string; @state() private _icon!: string;
@@ -59,6 +61,7 @@ class HaInputButtonForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -68,6 +71,7 @@ class HaInputButtonForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
</div> </div>
`; `;

View File

@@ -17,6 +17,8 @@ class HaInputDateTimeForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
private _item?: InputDateTime; private _item?: InputDateTime;
@state() private _name!: string; @state() private _name!: string;
@@ -73,6 +75,7 @@ class HaInputDateTimeForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -82,6 +85,7 @@ class HaInputDateTimeForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
<br /> <br />
${this.hass.localize("ui.dialogs.helper_settings.input_datetime.mode")}: ${this.hass.localize("ui.dialogs.helper_settings.input_datetime.mode")}:
@@ -97,6 +101,7 @@ class HaInputDateTimeForm extends LitElement {
value="date" value="date"
.checked=${this._mode === "date"} .checked=${this._mode === "date"}
@change=${this._modeChanged} @change=${this._modeChanged}
.disabled=${this.disabled}
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
<ha-formfield <ha-formfield
@@ -109,6 +114,7 @@ class HaInputDateTimeForm extends LitElement {
value="time" value="time"
.checked=${this._mode === "time"} .checked=${this._mode === "time"}
@change=${this._modeChanged} @change=${this._modeChanged}
.disabled=${this.disabled}
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
<ha-formfield <ha-formfield
@@ -121,6 +127,7 @@ class HaInputDateTimeForm extends LitElement {
value="datetime" value="datetime"
.checked=${this._mode === "datetime"} .checked=${this._mode === "datetime"}
@change=${this._modeChanged} @change=${this._modeChanged}
.disabled=${this.disabled}
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
</div> </div>

View File

@@ -18,6 +18,8 @@ class HaInputNumberForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
private _item?: Partial<InputNumber>; private _item?: Partial<InputNumber>;
@state() private _name!: string; @state() private _name!: string;
@@ -89,6 +91,7 @@ class HaInputNumberForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -98,6 +101,7 @@ class HaInputNumberForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
<ha-textfield <ha-textfield
.value=${this._min} .value=${this._min}
@@ -108,6 +112,7 @@ class HaInputNumberForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.input_number.min" "ui.dialogs.helper_settings.input_number.min"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-textfield <ha-textfield
.value=${this._max} .value=${this._max}
@@ -118,6 +123,7 @@ class HaInputNumberForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.input_number.max" "ui.dialogs.helper_settings.input_number.max"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-expansion-panel <ha-expansion-panel
header=${this.hass.localize( header=${this.hass.localize(
@@ -139,6 +145,7 @@ class HaInputNumberForm extends LitElement {
value="slider" value="slider"
.checked=${this._mode === "slider"} .checked=${this._mode === "slider"}
@change=${this._modeChanged} @change=${this._modeChanged}
.disabled=${this.disabled}
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
<ha-formfield <ha-formfield
@@ -151,6 +158,7 @@ class HaInputNumberForm extends LitElement {
value="box" value="box"
.checked=${this._mode === "box"} .checked=${this._mode === "box"}
@change=${this._modeChanged} @change=${this._modeChanged}
.disabled=${this.disabled}
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
</div> </div>
@@ -163,6 +171,7 @@ class HaInputNumberForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.input_number.step" "ui.dialogs.helper_settings.input_number.step"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-textfield <ha-textfield
@@ -172,6 +181,7 @@ class HaInputNumberForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.input_number.unit_of_measurement" "ui.dialogs.helper_settings.input_number.unit_of_measurement"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
</ha-expansion-panel> </ha-expansion-panel>
</div> </div>

View File

@@ -23,6 +23,8 @@ class HaInputSelectForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
private _item?: InputSelect; private _item?: InputSelect;
@state() private _name!: string; @state() private _name!: string;
@@ -86,6 +88,7 @@ class HaInputSelectForm extends LitElement {
)} )}
.configValue=${"name"} .configValue=${"name"}
@input=${this._valueChanged} @input=${this._valueChanged}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -95,13 +98,18 @@ class HaInputSelectForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
<div class="header"> <div class="header">
${this.hass!.localize( ${this.hass!.localize(
"ui.dialogs.helper_settings.input_select.options" "ui.dialogs.helper_settings.input_select.options"
)}: )}:
</div> </div>
<ha-sortable @item-moved=${this._optionMoved} handle-selector=".handle"> <ha-sortable
@item-moved=${this._optionMoved}
handle-selector=".handle"
.disabled=${this.disabled}
>
<ha-list class="options"> <ha-list class="options">
${this._options.length ${this._options.length
? repeat( ? repeat(
@@ -124,6 +132,7 @@ class HaInputSelectForm extends LitElement {
"ui.dialogs.helper_settings.input_select.remove_option" "ui.dialogs.helper_settings.input_select.remove_option"
)} )}
@click=${this._removeOption} @click=${this._removeOption}
.disabled=${this.disabled}
.path=${mdiDelete} .path=${mdiDelete}
></ha-icon-button> ></ha-icon-button>
</ha-list-item> </ha-list-item>
@@ -146,8 +155,13 @@ class HaInputSelectForm extends LitElement {
"ui.dialogs.helper_settings.input_select.add_option" "ui.dialogs.helper_settings.input_select.add_option"
)} )}
@keydown=${this._handleKeyAdd} @keydown=${this._handleKeyAdd}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-button size="small" appearance="plain" @click=${this._addOption} <ha-button
size="small"
appearance="plain"
@click=${this._addOption}
.disabled=${this.disabled}
>${this.hass!.localize( >${this.hass!.localize(
"ui.dialogs.helper_settings.input_select.add" "ui.dialogs.helper_settings.input_select.add"
)}</ha-button )}</ha-button

View File

@@ -19,6 +19,8 @@ class HaInputTextForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
private _item?: InputText; private _item?: InputText;
@state() private _name!: string; @state() private _name!: string;
@@ -79,6 +81,7 @@ class HaInputTextForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -88,6 +91,7 @@ class HaInputTextForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
<ha-expansion-panel <ha-expansion-panel
header=${this.hass.localize( header=${this.hass.localize(
@@ -105,6 +109,7 @@ class HaInputTextForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.input_text.min" "ui.dialogs.helper_settings.input_text.min"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-textfield <ha-textfield
.value=${this._max} .value=${this._max}
@@ -129,6 +134,7 @@ class HaInputTextForm extends LitElement {
value="text" value="text"
.checked=${this._mode === "text"} .checked=${this._mode === "text"}
@change=${this._modeChanged} @change=${this._modeChanged}
.disabled=${this.disabled}
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
<ha-formfield <ha-formfield
@@ -141,6 +147,7 @@ class HaInputTextForm extends LitElement {
value="password" value="password"
.checked=${this._mode === "password"} .checked=${this._mode === "password"}
@change=${this._modeChanged} @change=${this._modeChanged}
.disabled=${this.disabled}
></ha-radio> ></ha-radio>
</ha-formfield> </ha-formfield>
</div> </div>
@@ -154,6 +161,7 @@ class HaInputTextForm extends LitElement {
.helper=${this.hass!.localize( .helper=${this.hass!.localize(
"ui.dialogs.helper_settings.input_text.pattern_helper" "ui.dialogs.helper_settings.input_text.pattern_helper"
)} )}
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
</ha-expansion-panel> </ha-expansion-panel>
</div> </div>

View File

@@ -17,9 +17,9 @@ import "../../../../components/ha-textfield";
import type { Schedule, ScheduleDay } from "../../../../data/schedule"; import type { Schedule, ScheduleDay } from "../../../../data/schedule";
import { weekdays } from "../../../../data/schedule"; import { weekdays } from "../../../../data/schedule";
import { TimeZone } from "../../../../data/translation"; import { TimeZone } from "../../../../data/translation";
import { showScheduleBlockInfoDialog } from "./show-dialog-schedule-block-info";
import { haStyle } from "../../../../resources/styles"; import { haStyle } from "../../../../resources/styles";
import type { HomeAssistant } from "../../../../types"; import type { HomeAssistant } from "../../../../types";
import { showScheduleBlockInfoDialog } from "./show-dialog-schedule-block-info";
const defaultFullCalendarConfig: CalendarOptions = { const defaultFullCalendarConfig: CalendarOptions = {
plugins: [timeGridPlugin, interactionPlugin], plugins: [timeGridPlugin, interactionPlugin],
@@ -43,6 +43,8 @@ class HaScheduleForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
@state() private _name!: string; @state() private _name!: string;
@state() private _icon!: string; @state() private _icon!: string;
@@ -132,6 +134,7 @@ class HaScheduleForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -141,8 +144,9 @@ class HaScheduleForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
<div id="calendar"></div> ${!this.disabled ? html`<div id="calendar"></div>` : nothing}
</div> </div>
`; `;
} }
@@ -175,7 +179,9 @@ class HaScheduleForm extends LitElement {
} }
protected firstUpdated(): void { protected firstUpdated(): void {
this._setupCalendar(); if (!this.disabled) {
this._setupCalendar();
}
} }
private _setupCalendar(): void { private _setupCalendar(): void {

View File

@@ -1,18 +1,18 @@
import type { CSSResultGroup } from "lit"; import type { CSSResultGroup } from "lit";
import { css, html, LitElement, nothing } from "lit"; import { css, html, LitElement, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { createDurationData } from "../../../../common/datetime/create_duration_data";
import { fireEvent } from "../../../../common/dom/fire_event"; import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/ha-checkbox"; import "../../../../components/ha-checkbox";
import "../../../../components/ha-duration-input";
import type { HaDurationData } from "../../../../components/ha-duration-input";
import "../../../../components/ha-formfield"; import "../../../../components/ha-formfield";
import "../../../../components/ha-icon-picker"; import "../../../../components/ha-icon-picker";
import "../../../../components/ha-duration-input";
import "../../../../components/ha-textfield"; import "../../../../components/ha-textfield";
import type { ForDict } from "../../../../data/automation";
import type { DurationDict, Timer } from "../../../../data/timer"; import type { DurationDict, Timer } from "../../../../data/timer";
import { haStyle } from "../../../../resources/styles"; import { haStyle } from "../../../../resources/styles";
import type { HomeAssistant } from "../../../../types"; import type { HomeAssistant } from "../../../../types";
import { createDurationData } from "../../../../common/datetime/create_duration_data";
import type { HaDurationData } from "../../../../components/ha-duration-input";
import type { ForDict } from "../../../../data/automation";
@customElement("ha-timer-form") @customElement("ha-timer-form")
class HaTimerForm extends LitElement { class HaTimerForm extends LitElement {
@@ -20,6 +20,8 @@ class HaTimerForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ type: Boolean }) public disabled = false;
private _item?: Timer; private _item?: Timer;
@state() private _name!: string; @state() private _name!: string;
@@ -77,6 +79,7 @@ class HaTimerForm extends LitElement {
"ui.dialogs.helper_settings.required_error_msg" "ui.dialogs.helper_settings.required_error_msg"
)} )}
dialogInitialFocus dialogInitialFocus
.disabled=${this.disabled}
></ha-textfield> ></ha-textfield>
<ha-icon-picker <ha-icon-picker
.hass=${this.hass} .hass=${this.hass}
@@ -86,11 +89,13 @@ class HaTimerForm extends LitElement {
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
.disabled=${this.disabled}
></ha-icon-picker> ></ha-icon-picker>
<ha-duration-input <ha-duration-input
.configValue=${"duration"} .configValue=${"duration"}
.data=${this._duration_data} .data=${this._duration_data}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
.disabled=${this.disabled}
></ha-duration-input> ></ha-duration-input>
<ha-formfield <ha-formfield
.label=${this.hass.localize( .label=${this.hass.localize(
@@ -101,6 +106,7 @@ class HaTimerForm extends LitElement {
.configValue=${"restore"} .configValue=${"restore"}
.checked=${this._restore} .checked=${this._restore}
@click=${this._toggleRestore} @click=${this._toggleRestore}
.disabled=${this.disabled}
> >
</ha-checkbox> </ha-checkbox>
</ha-formfield> </ha-formfield>
@@ -130,6 +136,9 @@ class HaTimerForm extends LitElement {
} }
private _toggleRestore() { private _toggleRestore() {
if (this.disabled) {
return;
}
this._restore = !this._restore; this._restore = !this._restore;
fireEvent(this, "value-changed", { fireEvent(this, "value-changed", {
value: { ...this._item, restore: this._restore }, value: { ...this._item, restore: this._restore },

View File

@@ -107,6 +107,8 @@ class HaConfigInfo extends LitElement {
const customUiList: { name: string; url: string; version: string }[] = const customUiList: { name: string; url: string; version: string }[] =
(window as any).CUSTOM_UI_LIST || []; (window as any).CUSTOM_UI_LIST || [];
const isDark = this.hass.themes?.darkMode || false;
return html` return html`
<hass-subpage <hass-subpage
.hass=${this.hass} .hass=${this.hass}
@@ -186,7 +188,7 @@ class HaConfigInfo extends LitElement {
: nothing} : nothing}
</ul> </ul>
</ha-card> </ha-card>
<ha-card outlined class="ohf"> <ha-card outlined class="ohf ${isDark ? "dark" : ""}">
<div> <div>
${this.hass.localize("ui.panel.config.info.proud_part_of")} ${this.hass.localize("ui.panel.config.info.proud_part_of")}
</div> </div>
@@ -346,6 +348,10 @@ class HaConfigInfo extends LitElement {
max-width: 250px; max-width: 250px;
} }
.ohf.dark img {
color-scheme: dark;
}
.versions { .versions {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@@ -790,7 +790,10 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
); );
const timeString = new Date().toISOString().replace(/:/g, "-"); const timeString = new Date().toISOString().replace(/:/g, "-");
const logFileName = `home-assistant_${integration}_${timeString}.log`; const logFileName = `home-assistant_${integration}_${timeString}.log`;
const signedUrl = await getSignedPath(this.hass, getErrorLogDownloadUrl); const signedUrl = await getSignedPath(
this.hass,
getErrorLogDownloadUrl(this.hass)
);
fileDownload(signedUrl.path, logFileName); fileDownload(signedUrl.path, logFileName);
} }

View File

@@ -426,6 +426,10 @@ class DialogZHAReconfigureDevice extends LitElement {
return [ return [
haStyleDialog, haStyleDialog,
css` css`
ha-dialog {
--mdc-dialog-max-width: 800px;
}
.wrapper { .wrapper {
display: grid; display: grid;
grid-template-columns: 3fr 1fr 2fr; grid-template-columns: 3fr 1fr 2fr;

View File

@@ -82,7 +82,7 @@ class DialogLabelDetail
this.hass, this.hass,
this._params.entry this._params.entry
? this._params.entry.name || this._params.entry.label_id ? this._params.entry.name || this._params.entry.label_id
: this.hass!.localize("ui.panel.config.labels.detail.new_label") : this.hass!.localize("ui.dialogs.label-detail.new_label")
)} )}
> >
<div> <div>
@@ -95,11 +95,9 @@ class DialogLabelDetail
.value=${this._name} .value=${this._name}
.configValue=${"name"} .configValue=${"name"}
@input=${this._input} @input=${this._input}
.label=${this.hass!.localize( .label=${this.hass!.localize("ui.dialogs.label-detail.name")}
"ui.panel.config.labels.detail.name"
)}
.validationMessage=${this.hass!.localize( .validationMessage=${this.hass!.localize(
"ui.panel.config.labels.detail.required_error_msg" "ui.dialogs.label-detail.required_error_msg"
)} )}
required required
></ha-textfield> ></ha-textfield>
@@ -108,25 +106,21 @@ class DialogLabelDetail
.hass=${this.hass} .hass=${this.hass}
.configValue=${"icon"} .configValue=${"icon"}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
.label=${this.hass!.localize( .label=${this.hass!.localize("ui.dialogs.label-detail.icon")}
"ui.panel.config.labels.detail.icon"
)}
></ha-icon-picker> ></ha-icon-picker>
<ha-color-picker <ha-color-picker
.value=${this._color} .value=${this._color}
.configValue=${"color"} .configValue=${"color"}
.hass=${this.hass} .hass=${this.hass}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
.label=${this.hass!.localize( .label=${this.hass!.localize("ui.dialogs.label-detail.color")}
"ui.panel.config.labels.detail.color"
)}
></ha-color-picker> ></ha-color-picker>
<ha-textarea <ha-textarea
.value=${this._description} .value=${this._description}
.configValue=${"description"} .configValue=${"description"}
@input=${this._input} @input=${this._input}
.label=${this.hass!.localize( .label=${this.hass!.localize(
"ui.panel.config.labels.detail.description" "ui.dialogs.label-detail.description"
)} )}
></ha-textarea> ></ha-textarea>
</div> </div>
@@ -140,7 +134,7 @@ class DialogLabelDetail
@click=${this._deleteEntry} @click=${this._deleteEntry}
.disabled=${this._submitting} .disabled=${this._submitting}
> >
${this.hass!.localize("ui.panel.config.labels.detail.delete")} ${this.hass!.localize("ui.common.delete")}
</ha-button> </ha-button>
` `
: nothing} : nothing}
@@ -150,8 +144,8 @@ class DialogLabelDetail
.disabled=${this._submitting || !this._name} .disabled=${this._submitting || !this._name}
> >
${this._params.entry ${this._params.entry
? this.hass!.localize("ui.panel.config.labels.detail.update") ? this.hass!.localize("ui.common.update")
: this.hass!.localize("ui.panel.config.labels.detail.create")} : this.hass!.localize("ui.common.create")}
</ha-button> </ha-button>
</ha-dialog> </ha-dialog>
`; `;

View File

@@ -415,7 +415,7 @@ class ErrorLogCard extends LitElement {
const downloadUrl = const downloadUrl =
this.provider && this.provider !== "core" this.provider && this.provider !== "core"
? getHassioLogDownloadUrl(this.provider) ? getHassioLogDownloadUrl(this.provider)
: getErrorLogDownloadUrl; : getErrorLogDownloadUrl(this.hass);
const logFileName = const logFileName =
this.provider && this.provider !== "core" this.provider && this.provider !== "core"
? `${this.provider}_${timeString}.log` ? `${this.provider}_${timeString}.log`

View File

@@ -2,8 +2,6 @@ import { mdiDotsVertical, mdiDownload, mdiRefresh, mdiText } from "@mdi/js";
import { css, html, LitElement, nothing } from "lit"; import { css, html, LitElement, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import memoizeOne from "memoize-one"; import memoizeOne from "memoize-one";
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { atLeastVersion } from "../../../common/config/version";
import { fireEvent } from "../../../common/dom/fire_event"; import { fireEvent } from "../../../common/dom/fire_event";
import type { LocalizeFunc } from "../../../common/translations/localize"; import type { LocalizeFunc } from "../../../common/translations/localize";
import "../../../components/buttons/ha-call-service-button"; import "../../../components/buttons/ha-call-service-button";
@@ -15,7 +13,6 @@ import "../../../components/ha-list-item";
import "../../../components/ha-spinner"; import "../../../components/ha-spinner";
import { getSignedPath } from "../../../data/auth"; import { getSignedPath } from "../../../data/auth";
import { getErrorLogDownloadUrl } from "../../../data/error_log"; import { getErrorLogDownloadUrl } from "../../../data/error_log";
import { coreLatestLogsUrl } from "../../../data/hassio/supervisor";
import { domainToName } from "../../../data/integration"; import { domainToName } from "../../../data/integration";
import type { LoggedError } from "../../../data/system_log"; import type { LoggedError } from "../../../data/system_log";
import { import {
@@ -231,11 +228,7 @@ export class SystemLogCard extends LitElement {
private async _downloadLogs() { private async _downloadLogs() {
const timeString = new Date().toISOString().replace(/:/g, "-"); const timeString = new Date().toISOString().replace(/:/g, "-");
const downloadUrl = const downloadUrl = getErrorLogDownloadUrl(this.hass);
isComponentLoaded(this.hass, "hassio") &&
atLeastVersion(this.hass.config.version, 2025, 10)
? coreLatestLogsUrl
: getErrorLogDownloadUrl;
const logFileName = `home-assistant_${timeString}.log`; const logFileName = `home-assistant_${timeString}.log`;
const signedUrl = await getSignedPath(this.hass, downloadUrl); const signedUrl = await getSignedPath(this.hass, downloadUrl);
fileDownload(signedUrl.path, logFileName); fileDownload(signedUrl.path, logFileName);

View File

@@ -332,13 +332,13 @@ export class HaConfigLovelaceDashboards extends LitElement {
}); });
} }
if (this.hass.panels.safety) { if (this.hass.panels.security) {
result.push({ result.push({
icon: "mdi:security", icon: "mdi:security",
title: this.hass.localize("panel.safety"), title: this.hass.localize("panel.security"),
show_in_sidebar: false, show_in_sidebar: false,
mode: "storage", mode: "storage",
url_path: "safety", url_path: "security",
filename: "", filename: "",
default: false, default: false,
require_admin: false, require_admin: false,
@@ -470,13 +470,13 @@ export class HaConfigLovelaceDashboards extends LitElement {
} }
private _canDelete(urlPath: string) { private _canDelete(urlPath: string) {
return !["lovelace", "energy", "light", "safety", "climate"].includes( return !["lovelace", "energy", "light", "security", "climate"].includes(
urlPath urlPath
); );
} }
private _canEdit(urlPath: string) { private _canEdit(urlPath: string) {
return !["light", "safety", "climate"].includes(urlPath); return !["light", "security", "climate"].includes(urlPath);
} }
private _handleDelete = async (item: DataTableItem) => { private _handleDelete = async (item: DataTableItem) => {

View File

@@ -109,15 +109,26 @@ export class AssistPipelineDetailConversation extends LitElement {
} }
private _supportedLanguagesChanged(ev) { private _supportedLanguagesChanged(ev) {
if (ev.detail.value === "*") { this._supportedLanguages = ev.detail.value;
if (
this._supportedLanguages === "*" ||
!this._supportedLanguages?.includes(
this.data?.conversation_language || ""
) ||
!this.data?.conversation_language
) {
// wait for update of conversation_engine // wait for update of conversation_engine
setTimeout(() => { setTimeout(() => {
const value = { ...this.data }; const value = { ...this.data };
value.conversation_language = "*"; if (this._supportedLanguages === "*") {
value.conversation_language = "*";
} else {
value.conversation_language = this._supportedLanguages?.[0] ?? null;
}
fireEvent(this, "value-changed", { value }); fireEvent(this, "value-changed", { value });
}, 0); }, 0);
} }
this._supportedLanguages = ev.detail.value;
} }
static styles = css` static styles = css`

View File

@@ -139,12 +139,6 @@ export class AssistPipelineDebug extends LitElement {
@property({ attribute: false }) public pipelineRun!: PipelineRun; @property({ attribute: false }) public pipelineRun!: PipelineRun;
private _audioElement?: HTMLAudioElement;
private get _isPlaying(): boolean {
return this._audioElement != null && !this._audioElement.paused;
}
protected render(): TemplateResult { protected render(): TemplateResult {
const lastRunStage: string = this.pipelineRun const lastRunStage: string = this.pipelineRun
? ["tts", "intent", "stt", "wake_word"].find( ? ["tts", "intent", "stt", "wake_word"].find(
@@ -355,13 +349,8 @@ export class AssistPipelineDebug extends LitElement {
${this.pipelineRun?.tts?.tts_output ${this.pipelineRun?.tts?.tts_output
? html` ? html`
<div class="card-actions"> <div class="card-actions">
<ha-button <ha-button @click=${this._playTTS}>
.variant=${this._isPlaying ? "danger" : "brand"} Play Audio
@click=${this._isPlaying
? this._stopTTS
: this._playTTS}
>
${this._isPlaying ? "Stop audio" : "Play audio"}
</ha-button> </ha-button>
</div> </div>
` `
@@ -384,41 +373,14 @@ export class AssistPipelineDebug extends LitElement {
} }
private _playTTS(): void { private _playTTS(): void {
// Stop any existing audio first
this._stopTTS();
const url = this.pipelineRun!.tts!.tts_output!.url; const url = this.pipelineRun!.tts!.tts_output!.url;
this._audioElement = new Audio(url); const audio = new Audio(url);
audio.addEventListener("error", () => {
this._audioElement.addEventListener("error", () => {
showAlertDialog(this, { title: "Error", text: "Error playing audio" }); showAlertDialog(this, { title: "Error", text: "Error playing audio" });
}); });
audio.addEventListener("canplaythrough", () => {
this._audioElement.addEventListener("play", () => { audio.play();
this.requestUpdate();
}); });
this._audioElement.addEventListener("ended", () => {
this.requestUpdate();
});
this._audioElement.addEventListener("canplaythrough", () => {
this._audioElement!.play();
});
}
private _stopTTS(): void {
if (this._audioElement) {
this._audioElement.pause();
this._audioElement.currentTime = 0;
this._audioElement = undefined;
this.requestUpdate();
}
}
public disconnectedCallback(): void {
super.disconnectedCallback();
this._stopTTS();
} }
static styles = css` static styles = css`

View File

@@ -214,7 +214,7 @@ export class DialogVoiceAssistantPipelineDetail extends LitElement {
<ha-button <ha-button
slot="primaryAction" slot="primaryAction"
@click=${this._updatePipeline} @click=${this._updatePipeline}
.disabled=${this._submitting} .loading=${this._submitting}
dialogInitialFocus dialogInitialFocus
> >
${this._params.pipeline?.id ${this._params.pipeline?.id

View File

@@ -1,24 +1,23 @@
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit"; import type { CSSResultGroup, PropertyValues } from "lit";
import { LitElement, css, html } from "lit"; import { LitElement, css, html, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { goBack } from "../../common/navigate"; import { goBack } from "../../common/navigate";
import { debounce } from "../../common/util/debounce";
import { deepEqual } from "../../common/util/deep-equal";
import "../../components/ha-icon-button-arrow-prev"; import "../../components/ha-icon-button-arrow-prev";
import "../../components/ha-menu-button"; import "../../components/ha-menu-button";
import type { LovelaceConfig } from "../../data/lovelace/config/types"; import type { LovelaceStrategyViewConfig } from "../../data/lovelace/config/view";
import { haStyle } from "../../resources/styles"; import { haStyle } from "../../resources/styles";
import type { HomeAssistant } from "../../types"; import type { HomeAssistant } from "../../types";
import { generateLovelaceViewStrategy } from "../lovelace/strategies/get-strategy";
import type { Lovelace } from "../lovelace/types"; import type { Lovelace } from "../lovelace/types";
import "../lovelace/views/hui-view"; import "../lovelace/views/hui-view";
import "../lovelace/views/hui-view-container"; import "../lovelace/views/hui-view-container";
const LIGHT_LOVELACE_CONFIG: LovelaceConfig = { const LIGHT_LOVELACE_VIEW_CONFIG: LovelaceStrategyViewConfig = {
views: [ strategy: {
{ type: "light",
strategy: { },
type: "light",
},
},
],
}; };
@customElement("ha-panel-light") @customElement("ha-panel-light")
@@ -34,60 +33,118 @@ class PanelLight extends LitElement {
@state() private _searchParms = new URLSearchParams(window.location.search); @state() private _searchParms = new URLSearchParams(window.location.search);
public willUpdate(changedProps: PropertyValues) { public willUpdate(changedProps: PropertyValues) {
super.willUpdate(changedProps);
// Initial setup
if (!this.hasUpdated) { if (!this.hasUpdated) {
this.hass.loadFragmentTranslation("lovelace"); this.hass.loadFragmentTranslation("lovelace");
this._setLovelace();
return;
} }
if (!changedProps.has("hass")) { if (!changedProps.has("hass")) {
return; return;
} }
const oldHass = changedProps.get("hass") as this["hass"]; const oldHass = changedProps.get("hass") as this["hass"];
if (oldHass?.locale !== this.hass.locale) { if (oldHass && oldHass.localize !== this.hass.localize) {
this._setLovelace(); this._setLovelace();
return;
}
if (oldHass && this.hass) {
// If the entity registry changed, ask the user if they want to refresh the config
if (
oldHass.entities !== this.hass.entities ||
oldHass.devices !== this.hass.devices ||
oldHass.areas !== this.hass.areas ||
oldHass.floors !== this.hass.floors
) {
if (this.hass.config.state === "RUNNING") {
this._debounceRegistriesChanged();
return;
}
}
// If ha started, refresh the config
if (
this.hass.config.state === "RUNNING" &&
oldHass.config.state !== "RUNNING"
) {
this._setLovelace();
}
} }
} }
private _debounceRegistriesChanged = debounce(
() => this._registriesChanged(),
200
);
private _registriesChanged = async () => {
this._setLovelace();
};
private _back(ev) { private _back(ev) {
ev.stopPropagation(); ev.stopPropagation();
goBack(); goBack();
} }
protected render(): TemplateResult { protected render() {
return html` return html`
<div class="header"> <div class="header">
<div class="toolbar"> <div class="toolbar">
${this._searchParms.has("historyBack") ${
? html` this._searchParms.has("historyBack")
<ha-icon-button-arrow-prev ? html`
@click=${this._back} <ha-icon-button-arrow-prev
slot="navigationIcon" @click=${this._back}
></ha-icon-button-arrow-prev> slot="navigationIcon"
` ></ha-icon-button-arrow-prev>
: html` `
<ha-menu-button : html`
slot="navigationIcon" <ha-menu-button
.hass=${this.hass} slot="navigationIcon"
.narrow=${this.narrow} .hass=${this.hass}
></ha-menu-button> .narrow=${this.narrow}
`} ></ha-menu-button>
`
}
<div class="main-title">${this.hass.localize("panel.light")}</div> <div class="main-title">${this.hass.localize("panel.light")}</div>
</div> </div>
</div> </div>
${
<hui-view-container .hass=${this.hass}> this._lovelace
<hui-view ? html`
.hass=${this.hass} <hui-view-container .hass=${this.hass}>
.narrow=${this.narrow} <hui-view
.lovelace=${this._lovelace} .hass=${this.hass}
.index=${this._viewIndex} .narrow=${this.narrow}
></hui-view> .lovelace=${this._lovelace}
.index=${this._viewIndex}
></hui-view
></hui-view-container>
`
: nothing
}
</hui-view-container> </hui-view-container>
`; `;
} }
private _setLovelace() { private async _setLovelace() {
const viewConfig = await generateLovelaceViewStrategy(
LIGHT_LOVELACE_VIEW_CONFIG,
this.hass
);
const config = { views: [viewConfig] };
const rawConfig = { views: [LIGHT_LOVELACE_VIEW_CONFIG] };
if (deepEqual(config, this._lovelace?.config)) {
return;
}
this._lovelace = { this._lovelace = {
config: LIGHT_LOVELACE_CONFIG, config: config,
rawConfig: LIGHT_LOVELACE_CONFIG, rawConfig: rawConfig,
editMode: false, editMode: false,
urlPath: "light", urlPath: "light",
mode: "generated", mode: "generated",

View File

@@ -61,6 +61,24 @@ const processAreasForLight = (
return cards; return cards;
}; };
const processUnassignedLights = (
hass: HomeAssistant,
entities: string[]
): LovelaceCardConfig[] => {
const unassignedFilter = generateEntityFilter(hass, {
area: null,
});
const unassignedLights = entities.filter(unassignedFilter);
const areaCards: LovelaceCardConfig[] = [];
const computeTileCard = computeAreaTileCardConfig(hass, "", false);
for (const entityId of unassignedLights) {
areaCards.push(computeTileCard(entityId));
}
return areaCards;
};
@customElement("light-view-strategy") @customElement("light-view-strategy")
export class LightViewStrategy extends ReactiveElement { export class LightViewStrategy extends ReactiveElement {
static async generate( static async generate(
@@ -136,10 +154,30 @@ export class LightViewStrategy extends ReactiveElement {
} }
} }
// Process unassigned lights
const unassignedCards = processUnassignedLights(hass, entities);
if (unassignedCards.length > 0) {
const section: LovelaceSectionRawConfig = {
type: "grid",
column_span: 2,
cards: [
{
type: "heading",
heading:
sections.length > 0
? hass.localize("ui.panel.lovelace.strategy.light.other_lights")
: hass.localize("ui.panel.lovelace.strategy.light.lights"),
},
...unassignedCards,
],
};
sections.push(section);
}
return { return {
type: "sections", type: "sections",
max_columns: 2, max_columns: 2,
sections: sections || [], sections: sections,
}; };
} }
} }

View File

@@ -52,8 +52,6 @@ export class HaLogbook extends LitElement {
@property({ attribute: false }) public deviceIds?: string[]; @property({ attribute: false }) public deviceIds?: string[];
@property({ attribute: false }) public stateFilter?: string[];
@property({ type: Boolean }) public narrow = false; @property({ type: Boolean }) public narrow = false;
@property({ type: Boolean, reflect: true }) public virtualize = false; @property({ type: Boolean, reflect: true }) public virtualize = false;
@@ -167,7 +165,7 @@ export class HaLogbook extends LitElement {
protected willUpdate(changedProps: PropertyValues): void { protected willUpdate(changedProps: PropertyValues): void {
let changed = changedProps.has("time"); let changed = changedProps.has("time");
for (const key of ["entityIds", "deviceIds", "stateFilter"]) { for (const key of ["entityIds", "deviceIds"]) {
if (!changedProps.has(key)) { if (!changedProps.has(key)) {
continue; continue;
} }
@@ -354,19 +352,9 @@ export class HaLogbook extends LitElement {
"recent" in this.time "recent" in this.time
? findStartOfRecentTime(new Date(), this.time.recent) ? findStartOfRecentTime(new Date(), this.time.recent)
: undefined; : undefined;
let eventsFiltered: LogbookEntry[] | undefined;
if (this.stateFilter && this.stateFilter.length > 0) {
eventsFiltered = streamMessage.events.filter(
(e) => e.state && this.stateFilter?.includes(e.state)
);
} else {
eventsFiltered = [...streamMessage.events];
}
// Put newest ones on top. Reverse works in-place so // Put newest ones on top. Reverse works in-place so
// make a copy first. // make a copy first.
const newEntries = eventsFiltered.reverse(); const newEntries = [...streamMessage.events].reverse();
if (!this._logbookEntries || !this._logbookEntries.length) { if (!this._logbookEntries || !this._logbookEntries.length) {
this._logbookEntries = newEntries; this._logbookEntries = newEntries;
return; return;

View File

@@ -8,6 +8,7 @@ import memoizeOne from "memoize-one";
import type { BarSeriesOption, PieSeriesOption } from "echarts/charts"; import type { BarSeriesOption, PieSeriesOption } from "echarts/charts";
import { PieChart } from "echarts/charts"; import { PieChart } from "echarts/charts";
import type { ECElementEvent } from "echarts/types/dist/shared"; import type { ECElementEvent } from "echarts/types/dist/shared";
import type { PieDataItemOption } from "echarts/types/src/chart/pie/PieSeries";
import { filterXSS } from "../../../../common/util/xss"; import { filterXSS } from "../../../../common/util/xss";
import { getGraphColorByIndex } from "../../../../common/color/colors"; import { getGraphColorByIndex } from "../../../../common/color/colors";
import { formatNumber } from "../../../../common/number/format_number"; import { formatNumber } from "../../../../common/number/format_number";
@@ -387,6 +388,7 @@ export class HuiEnergyDevicesGraphCard
}); });
if (this._chartType === "pie") { if (this._chartType === "pie") {
const pieChartData = chartData as NonNullable<PieSeriesOption["data"]>;
const { summedData, compareSummedData } = getSummedData(energyData); const { summedData, compareSummedData } = getSummedData(energyData);
const { consumption, compareConsumption } = computeConsumptionData( const { consumption, compareConsumption } = computeConsumptionData(
summedData, summedData,
@@ -399,7 +401,10 @@ export class HuiEnergyDevicesGraphCard
"from_battery" in summedData; "from_battery" in summedData;
const untracked = showUntracked const untracked = showUntracked
? totalUsed - ? totalUsed -
chartData.reduce((acc: number, d: any) => acc + d.value[0], 0) pieChartData.reduce(
(acc: number, d) => acc + (d as PieDataItemOption).value![0],
0
)
: 0; : 0;
if (untracked > 0) { if (untracked > 0) {
const color = getEnergyColor( const color = getEnergyColor(
@@ -409,7 +414,7 @@ export class HuiEnergyDevicesGraphCard
false, false,
"--history-unknown-color" "--history-unknown-color"
); );
chartData.push({ pieChartData.push({
id: "untracked", id: "untracked",
value: [untracked, "untracked"] as any, value: [untracked, "untracked"] as any,
name: this.hass.localize( name: this.hass.localize(
@@ -442,13 +447,20 @@ export class HuiEnergyDevicesGraphCard
} }
} }
} }
const totalChart = pieChartData.reduce(
(acc: number, d) =>
this._hiddenStats.includes((d as PieDataItemOption).id as string)
? acc
: acc + (d as PieDataItemOption).value![0],
0
);
datasets.push({ datasets.push({
type: "pie", type: "pie",
radius: ["0%", compareData ? "30%" : "40%"], radius: ["0%", compareData ? "30%" : "40%"],
name: this.hass.localize( name: this.hass.localize(
"ui.panel.lovelace.cards.energy.energy_devices_graph.total_energy_usage" "ui.panel.lovelace.cards.energy.energy_devices_graph.total_energy_usage"
), ),
data: [totalUsed], data: [totalChart],
label: { label: {
show: true, show: true,
position: "center", position: "center",
@@ -456,7 +468,7 @@ export class HuiEnergyDevicesGraphCard
fontSize: computedStyle.getPropertyValue("--ha-font-size-l"), fontSize: computedStyle.getPropertyValue("--ha-font-size-l"),
lineHeight: 24, lineHeight: 24,
fontWeight: "bold", fontWeight: "bold",
formatter: `{a}\n${formatNumber(totalUsed, this.hass.locale)} kWh`, formatter: `{a}\n${formatNumber(totalChart, this.hass.locale)} kWh`,
}, },
cursor: "default", cursor: "default",
itemStyle: { itemStyle: {

View File

@@ -419,13 +419,15 @@ class HuiEnergySankeyCard
}; };
deviceNodes.forEach((deviceNode) => { deviceNodes.forEach((deviceNode) => {
const entity = this.hass.states[deviceNode.id]; const entity = this.hass.states[deviceNode.id];
const { area, floor } = getEntityContext( const { area, floor } = entity
entity, ? getEntityContext(
this.hass.entities, entity,
this.hass.devices, this.hass.entities,
this.hass.areas, this.hass.devices,
this.hass.floors this.hass.areas,
); this.hass.floors
)
: { area: null, floor: null };
if (area) { if (area) {
if (area.area_id in areas) { if (area.area_id in areas) {
areas[area.area_id].value += deviceNode.value; areas[area.area_id].value += deviceNode.value;

View File

@@ -33,7 +33,7 @@ import type { HomeSummaryCard } from "./types";
const COLORS: Record<HomeSummary, string> = { const COLORS: Record<HomeSummary, string> = {
light: "amber", light: "amber",
climate: "deep-orange", climate: "deep-orange",
safety: "blue-grey", security: "blue-grey",
media_players: "blue", media_players: "blue",
}; };
@@ -87,11 +87,6 @@ export class HuiHomeSummaryCard extends LitElement implements LovelaceCard {
const allEntities = Object.keys(this.hass!.states); const allEntities = Object.keys(this.hass!.states);
const areas = Object.values(this.hass.areas); const areas = Object.values(this.hass.areas);
const areasFilter = generateEntityFilter(this.hass, {
area: areas.map((area) => area.area_id),
});
const entitiesInsideArea = allEntities.filter(areasFilter);
switch (this._config.summary) { switch (this._config.summary) {
case "light": { case "light": {
@@ -100,7 +95,7 @@ export class HuiHomeSummaryCard extends LitElement implements LovelaceCard {
generateEntityFilter(this.hass!, filter) generateEntityFilter(this.hass!, filter)
); );
const lightEntities = findEntities(entitiesInsideArea, lightsFilters); const lightEntities = findEntities(allEntities, lightsFilters);
const onLights = lightEntities.filter((entityId) => { const onLights = lightEntities.filter((entityId) => {
const s = this.hass!.states[entityId]?.state; const s = this.hass!.states[entityId]?.state;
@@ -147,20 +142,20 @@ export class HuiHomeSummaryCard extends LitElement implements LovelaceCard {
? `${formattedMinTemp}°` ? `${formattedMinTemp}°`
: `${formattedMinTemp} - ${formattedMaxTemp}°`; : `${formattedMinTemp} - ${formattedMaxTemp}°`;
} }
case "safety": { case "security": {
// Alarm and lock status // Alarm and lock status
const safetyFilters = HOME_SUMMARIES_FILTERS.safety.map((filter) => const securityFilters = HOME_SUMMARIES_FILTERS.security.map((filter) =>
generateEntityFilter(this.hass!, filter) generateEntityFilter(this.hass!, filter)
); );
const safetyEntities = findEntities(entitiesInsideArea, safetyFilters); const securityEntities = findEntities(allEntities, securityFilters);
const locks = safetyEntities.filter((entityId) => { const locks = securityEntities.filter((entityId) => {
const domain = computeDomain(entityId); const domain = computeDomain(entityId);
return domain === "lock"; return domain === "lock";
}); });
const alarms = safetyEntities.filter((entityId) => { const alarms = securityEntities.filter((entityId) => {
const domain = computeDomain(entityId); const domain = computeDomain(entityId);
return domain === "alarm_control_panel"; return domain === "alarm_control_panel";
}); });
@@ -204,7 +199,7 @@ export class HuiHomeSummaryCard extends LitElement implements LovelaceCard {
); );
const mediaPlayerEntities = findEntities( const mediaPlayerEntities = findEntities(
entitiesInsideArea, allEntities,
mediaPlayerFilters mediaPlayerFilters
); );

View File

@@ -64,8 +64,6 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard {
@state() private _targetPickerValue: HassServiceTarget = {}; @state() private _targetPickerValue: HassServiceTarget = {};
@state() private _stateFilter?: string[];
public getCardSize(): number { public getCardSize(): number {
return 9 + (this._config?.title ? 1 : 0); return 9 + (this._config?.title ? 1 : 0);
} }
@@ -131,8 +129,6 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard {
}; };
this._targetPickerValue = target; this._targetPickerValue = target;
this._stateFilter = ensureArray(config.state_filter);
} }
private _getEntityIds(): string[] | undefined { private _getEntityIds(): string[] | undefined {
@@ -213,7 +209,6 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard {
.hass=${this.hass} .hass=${this.hass}
.time=${this._time} .time=${this._time}
.entityIds=${this._getEntityIds()} .entityIds=${this._getEntityIds()}
.stateFilter=${this._stateFilter}
narrow narrow
relative-time relative-time
virtualize virtualize

View File

@@ -175,9 +175,9 @@ export class HuiStatisticsGraphCard extends LitElement implements LovelaceCard {
this._names = {}; this._names = {};
this._entities.forEach((config) => { this._entities.forEach((config) => {
const stateObj = this.hass!.states[config.entity]; const stateObj = this.hass!.states[config.entity];
this._names[config.entity] = stateObj this._names[config.entity] =
? computeLovelaceEntityName(this.hass!, stateObj, config.name) computeLovelaceEntityName(this.hass!, stateObj, config.name) ||
: config.entity; config.entity;
}); });
} }

View File

@@ -345,7 +345,6 @@ export interface LogbookCardConfig extends LovelaceCardConfig {
title?: string; title?: string;
hours_to_show?: number; hours_to_show?: number;
theme?: string; theme?: string;
state_filter?: string[];
} }
export interface MapEntityConfig extends EntityConfig { export interface MapEntityConfig extends EntityConfig {

View File

@@ -51,7 +51,8 @@ export const coordinates = (
width: number, width: number,
height: number, height: number,
maxDetails: number, maxDetails: number,
limits?: { minX?: number; maxX?: number; minY?: number; maxY?: number } limits?: { minX?: number; maxX?: number; minY?: number; maxY?: number },
useMean = false
) => { ) => {
history = history.filter((item) => !Number.isNaN(item[1])); history = history.filter((item) => !Number.isNaN(item[1]));
@@ -59,7 +60,8 @@ export const coordinates = (
history, history,
maxDetails, maxDetails,
limits?.minX, limits?.minX,
limits?.maxX limits?.maxX,
useMean
); );
return calcPoints(sampledData, width, height, limits); return calcPoints(sampledData, width, height, limits);
}; };
@@ -69,7 +71,8 @@ export const coordinatesMinimalResponseCompressedState = (
width: number, width: number,
height: number, height: number,
maxDetails: number, maxDetails: number,
limits?: { minX?: number; maxX?: number; minY?: number; maxY?: number } limits?: { minX?: number; maxX?: number; minY?: number; maxY?: number },
useMean = false
) => { ) => {
if (!history?.length) { if (!history?.length) {
return { points: [], yAxisOrigin: 0 }; return { points: [], yAxisOrigin: 0 };
@@ -81,5 +84,5 @@ export const coordinatesMinimalResponseCompressedState = (
item.lu * 1000, item.lu * 1000,
Number(item.s), Number(item.s),
]); ]);
return coordinates(mappedHistory, width, height, maxDetails, limits); return coordinates(mappedHistory, width, height, maxDetails, limits, useMean);
}; };

View File

@@ -67,7 +67,7 @@ export const handleAction = async (
await hass.loadBackendTranslation("title"); await hass.loadBackendTranslation("title");
const localize = await hass.loadBackendTranslation("services"); const localize = await hass.loadBackendTranslation("services");
serviceName = `${domainToName(localize, domain)}: ${ serviceName = `${domainToName(localize, domain)}: ${
localize(`component.${domain}.services.${serviceName}.name`) || localize(`component.${domain}.services.${service}.name`) ||
serviceDomains[domain][service].name || serviceDomains[domain][service].name ||
service service
}`; }`;

View File

@@ -39,29 +39,31 @@ export class HuiEntityEditor extends LitElement {
private _renderItem(item: EntityConfig, index: number) { private _renderItem(item: EntityConfig, index: number) {
const stateObj = this.hass.states[item.entity]; const stateObj = this.hass.states[item.entity];
const useDeviceName = entityUseDeviceName( const useDeviceName =
stateObj, stateObj &&
this.hass.entities, entityUseDeviceName(stateObj, this.hass.entities, this.hass.devices);
this.hass.devices
);
const isRTL = computeRTL(this.hass); const isRTL = computeRTL(this.hass);
const primary = const primary =
(stateObj &&
this.hass.formatEntityName(
stateObj,
useDeviceName ? { type: "device" } : { type: "entity" }
)) ||
item.entity;
const secondary =
stateObj &&
this.hass.formatEntityName( this.hass.formatEntityName(
stateObj, stateObj,
useDeviceName ? { type: "device" } : { type: "entity" } useDeviceName
) || item.entity; ? [{ type: "area" }]
: [{ type: "area" }, { type: "device" }],
const secondary = this.hass.formatEntityName( {
stateObj, separator: isRTL ? " ◂ " : " ▸ ",
useDeviceName }
? [{ type: "area" }] );
: [{ type: "area" }, { type: "device" }],
{
separator: isRTL ? " ◂ " : " ▸ ",
}
);
return html` return html`
<ha-md-list-item class="item"> <ha-md-list-item class="item">

View File

@@ -17,6 +17,7 @@ import type { HomeAssistant } from "../../../../types";
import { showSaveSuccessToast } from "../../../../util/toast-saved-success"; import { showSaveSuccessToast } from "../../../../util/toast-saved-success";
import "../../cards/hui-card"; import "../../cards/hui-card";
import "../../sections/hui-section"; import "../../sections/hui-section";
import { getViewType } from "../../views/get-view-type";
import { addCards, addSection } from "../config-util"; import { addCards, addSection } from "../config-util";
import type { LovelaceContainerPath } from "../lovelace-path"; import type { LovelaceContainerPath } from "../lovelace-path";
import { parseLovelaceContainerPath } from "../lovelace-path"; import { parseLovelaceContainerPath } from "../lovelace-path";
@@ -66,7 +67,9 @@ export class HuiDialogSuggestCard extends LitElement {
const { viewIndex } = parseLovelaceContainerPath(this._params.path); const { viewIndex } = parseLovelaceContainerPath(this._params.path);
const viewConfig = this._params!.lovelaceConfig.views[viewIndex]; const viewConfig = this._params!.lovelaceConfig.views[viewIndex];
return !isStrategyView(viewConfig) && viewConfig.type === "sections"; return (
!isStrategyView(viewConfig) && getViewType(viewConfig) === "sections"
);
} }
private _renderPreview() { private _renderPreview() {

View File

@@ -1,4 +1,5 @@
import { html, LitElement, nothing } from "lit"; import type { HassServiceTarget } from "home-assistant-js-websocket";
import { css, html, LitElement, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { import {
array, array,
@@ -9,23 +10,20 @@ import {
optional, optional,
string, string,
} from "superstruct"; } from "superstruct";
import type { HassServiceTarget } from "home-assistant-js-websocket";
import memoizeOne from "memoize-one";
import { fireEvent } from "../../../../common/dom/fire_event"; import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/entity/ha-entities-picker"; import "../../../../components/entity/ha-entities-picker";
import "../../../../components/ha-target-picker";
import "../../../../components/ha-form/ha-form"; import "../../../../components/ha-form/ha-form";
import type { SchemaUnion } from "../../../../components/ha-form/types"; import type { SchemaUnion } from "../../../../components/ha-form/types";
import "../../../../components/ha-target-picker";
import type { HaEntityPickerEntityFilterFunc } from "../../../../data/entity";
import { filterLogbookCompatibleEntities } from "../../../../data/logbook"; import { filterLogbookCompatibleEntities } from "../../../../data/logbook";
import { targetStruct } from "../../../../data/script";
import { getSensorNumericDeviceClasses } from "../../../../data/sensor";
import type { HomeAssistant } from "../../../../types"; import type { HomeAssistant } from "../../../../types";
import { DEFAULT_HOURS_TO_SHOW } from "../../cards/hui-logbook-card";
import type { LogbookCardConfig } from "../../cards/types"; import type { LogbookCardConfig } from "../../cards/types";
import type { LovelaceCardEditor } from "../../types"; import type { LovelaceCardEditor } from "../../types";
import { baseLovelaceCardConfig } from "../structs/base-card-struct"; import { baseLovelaceCardConfig } from "../structs/base-card-struct";
import { DEFAULT_HOURS_TO_SHOW } from "../../cards/hui-logbook-card";
import { targetStruct } from "../../../../data/script";
import { getSensorNumericDeviceClasses } from "../../../../data/sensor";
import type { HaEntityPickerEntityFilterFunc } from "../../../../data/entity";
import { resolveEntityIDs } from "../../../../data/selector";
const cardConfigStruct = assign( const cardConfigStruct = assign(
baseLovelaceCardConfig, baseLovelaceCardConfig,
@@ -35,7 +33,6 @@ const cardConfigStruct = assign(
hours_to_show: optional(number()), hours_to_show: optional(number()),
theme: optional(string()), theme: optional(string()),
target: optional(targetStruct), target: optional(targetStruct),
state_filter: optional(array(string())),
}) })
); );
@@ -53,13 +50,6 @@ const SCHEMA = [
}, },
], ],
}, },
{
name: "state_filter",
context: {
filter_entity: "context_entities",
},
selector: { state: { multiple: true } },
},
] as const; ] as const;
@customElement("hui-logbook-card-editor") @customElement("hui-logbook-card-editor")
@@ -116,13 +106,7 @@ export class HuiLogbookCardEditor
return html` return html`
<ha-form <ha-form
.hass=${this.hass} .hass=${this.hass}
.data=${this._data( .data=${this._config}
this._config,
this._targetPicker,
this.hass.entities,
this.hass.devices,
this.hass.areas
)}
.schema=${SCHEMA} .schema=${SCHEMA}
.computeLabel=${this._computeLabelCallback} .computeLabel=${this._computeLabelCallback}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
@@ -132,31 +116,11 @@ export class HuiLogbookCardEditor
.hass=${this.hass} .hass=${this.hass}
.entityFilter=${this._filterFunc} .entityFilter=${this._filterFunc}
.value=${this._targetPicker} .value=${this._targetPicker}
add-on-top
@value-changed=${this._entitiesChanged} @value-changed=${this._entitiesChanged}
></ha-target-picker> ></ha-target-picker>
`; `;
} }
private _data = memoizeOne(
(
config: LogbookCardConfig,
target: HassServiceTarget,
entities: HomeAssistant["entities"],
devices: HomeAssistant["devices"],
areas: HomeAssistant["areas"]
) => ({
...config,
context_entities: resolveEntityIDs(
this.hass!,
target,
entities,
devices,
areas
),
})
);
private _filterFunc: HaEntityPickerEntityFilterFunc = (entity) => private _filterFunc: HaEntityPickerEntityFilterFunc = (entity) =>
filterLogbookCompatibleEntities(entity, this._sensorNumericDeviceClasses); filterLogbookCompatibleEntities(entity, this._sensorNumericDeviceClasses);
@@ -166,9 +130,7 @@ export class HuiLogbookCardEditor
} }
private _valueChanged(ev: CustomEvent): void { private _valueChanged(ev: CustomEvent): void {
const newConfig = { ...ev.detail.value }; fireEvent(this, "config-changed", { config: ev.detail.value });
delete newConfig.context_entities;
fireEvent(this, "config-changed", { config: newConfig });
} }
private _computeLabelCallback = (schema: SchemaUnion<typeof SCHEMA>) => { private _computeLabelCallback = (schema: SchemaUnion<typeof SCHEMA>) => {
@@ -179,16 +141,19 @@ export class HuiLogbookCardEditor
)} (${this.hass!.localize( )} (${this.hass!.localize(
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})`; )})`;
case "state_filter":
return this.hass!.localize(
"ui.panel.lovelace.editor.card.logbook.state_filter"
);
default: default:
return this.hass!.localize( return this.hass!.localize(
`ui.panel.lovelace.editor.card.generic.${schema.name}` `ui.panel.lovelace.editor.card.generic.${schema.name}`
); );
} }
}; };
static styles = css`
ha-target-picker {
display: block;
margin-top: var(--ha-space-4);
}
`;
} }
declare global { declare global {

View File

@@ -155,16 +155,20 @@ export class HuiGraphHeaderFooter
} }
const width = this.clientWidth || this.offsetWidth; const width = this.clientWidth || this.offsetWidth;
// sample to 1 point per hour or 1 point per 5 pixels // sample to 1 point per hour or 1 point per 5 pixels
const maxDetails = const maxDetails = Math.max(
10,
this._config.detail! > 1 this._config.detail! > 1
? Math.max(width / 5, this._config.hours_to_show!) ? Math.max(width / 5, this._config.hours_to_show!)
: this._config.hours_to_show!; : this._config.hours_to_show!
);
const useMean = this._config.detail !== 2;
const { points } = coordinatesMinimalResponseCompressedState( const { points } = coordinatesMinimalResponseCompressedState(
combinedHistory[this._config.entity], combinedHistory[this._config.entity],
width, width,
width / 5, width / 5,
maxDetails, maxDetails,
{ minY: this._config.limits?.min, maxY: this._config.limits?.max } { minY: this._config.limits?.min, maxY: this._config.limits?.max },
useMean
); );
this._coordinates = points; this._coordinates = points;
}, },
@@ -218,6 +222,9 @@ export class HuiGraphHeaderFooter
} }
static styles = css` static styles = css`
:host {
display: block;
}
ha-spinner { ha-spinner {
position: absolute; position: absolute;
top: calc(50% - 14px); top: calc(50% - 14px);

View File

@@ -322,6 +322,7 @@ class HUIRoot extends LitElement {
.path=${item.icon} .path=${item.icon}
slot="trigger" slot="trigger"
.label=${label} .label=${label}
hide-title
></ha-icon-button> ></ha-icon-button>
${item.subItems ${item.subItems
.filter((subItem) => subItem.visible) .filter((subItem) => subItem.visible)
@@ -348,8 +349,10 @@ class HUIRoot extends LitElement {
.id="button-${index}" .id="button-${index}"
.path=${item.icon} .path=${item.icon}
@click=${item.buttonAction} @click=${item.buttonAction}
.label=${label}
></ha-icon-button> ></ha-icon-button>
<ha-tooltip placement="bottom" .for="button-${index}">
${label}
</ha-tooltip>
`; `;
result.push(button); result.push(button);
}); });
@@ -388,12 +391,11 @@ class HUIRoot extends LitElement {
slot="trigger" slot="trigger"
id="dashboardmenu" id="dashboardmenu"
.path=${mdiDotsVertical} .path=${mdiDotsVertical}
.label=${this.hass!.localize("ui.panel.lovelace.editor.menu.open")}
hide-title
></ha-icon-button> ></ha-icon-button>
${listItems} ${listItems}
</ha-button-menu> </ha-button-menu>
<ha-tooltip placement="bottom" for="dashboardmenu">
${this.hass!.localize("ui.panel.lovelace.editor.menu.open")}
</ha-tooltip>
`); `);
} }
return html`${result}`; return html`${result}`;

View File

@@ -48,7 +48,7 @@ const STRATEGIES: Record<LovelaceStrategyConfigType, Record<string, any>> = {
import("./home/home-media-players-view-strategy"), import("./home/home-media-players-view-strategy"),
"home-area": () => import("./home/home-area-view-strategy"), "home-area": () => import("./home/home-area-view-strategy"),
light: () => import("../../light/strategies/light-view-strategy"), light: () => import("../../light/strategies/light-view-strategy"),
safety: () => import("../../safety/strategies/safety-view-strategy"), security: () => import("../../security/strategies/security-view-strategy"),
climate: () => import("../../climate/strategies/climate-view-strategy"), climate: () => import("../../climate/strategies/climate-view-strategy"),
}, },
section: { section: {

View File

@@ -2,12 +2,12 @@ import type { EntityFilter } from "../../../../../common/entity/entity_filter";
import type { LocalizeFunc } from "../../../../../common/translations/localize"; import type { LocalizeFunc } from "../../../../../common/translations/localize";
import { climateEntityFilters } from "../../../../climate/strategies/climate-view-strategy"; import { climateEntityFilters } from "../../../../climate/strategies/climate-view-strategy";
import { lightEntityFilters } from "../../../../light/strategies/light-view-strategy"; import { lightEntityFilters } from "../../../../light/strategies/light-view-strategy";
import { safetyEntityFilters } from "../../../../safety/strategies/safety-view-strategy"; import { securityEntityFilters } from "../../../../security/strategies/security-view-strategy";
export const HOME_SUMMARIES = [ export const HOME_SUMMARIES = [
"light", "light",
"climate", "climate",
"safety", "security",
"media_players", "media_players",
] as const; ] as const;
@@ -16,14 +16,14 @@ export type HomeSummary = (typeof HOME_SUMMARIES)[number];
export const HOME_SUMMARIES_ICONS: Record<HomeSummary, string> = { export const HOME_SUMMARIES_ICONS: Record<HomeSummary, string> = {
light: "mdi:lamps", light: "mdi:lamps",
climate: "mdi:home-thermometer", climate: "mdi:home-thermometer",
safety: "mdi:security", security: "mdi:security",
media_players: "mdi:multimedia", media_players: "mdi:multimedia",
}; };
export const HOME_SUMMARIES_FILTERS: Record<HomeSummary, EntityFilter[]> = { export const HOME_SUMMARIES_FILTERS: Record<HomeSummary, EntityFilter[]> = {
light: lightEntityFilters, light: lightEntityFilters,
climate: climateEntityFilters, climate: climateEntityFilters,
safety: safetyEntityFilters, security: securityEntityFilters,
media_players: [{ domain: "media_player", entity_category: "none" }], media_players: [{ domain: "media_player", entity_category: "none" }],
}; };
@@ -31,7 +31,7 @@ export const getSummaryLabel = (
localize: LocalizeFunc, localize: LocalizeFunc,
summary: HomeSummary summary: HomeSummary
) => { ) => {
if (summary === "light" || summary === "climate" || summary === "safety") { if (summary === "light" || summary === "climate" || summary === "security") {
return localize(`panel.${summary}`); return localize(`panel.${summary}`);
} }
return localize(`ui.panel.lovelace.strategy.home.summary_list.${summary}`); return localize(`ui.panel.lovelace.strategy.home.summary_list.${summary}`);

View File

@@ -104,7 +104,7 @@ export class HomeAreaViewStrategy extends ReactiveElement {
const { const {
light, light,
climate, climate,
safety, security,
media_players: mediaPlayers, media_players: mediaPlayers,
} = entitiesBySummary; } = entitiesBySummary;
@@ -136,16 +136,16 @@ export class HomeAreaViewStrategy extends ReactiveElement {
}); });
} }
if (safety.length > 0) { if (security.length > 0) {
sections.push({ sections.push({
type: "grid", type: "grid",
cards: [ cards: [
computeHeadingCard( computeHeadingCard(
getSummaryLabel(hass.localize, "safety"), getSummaryLabel(hass.localize, "security"),
HOME_SUMMARIES_ICONS.safety, HOME_SUMMARIES_ICONS.security,
"/safety?historyBack=1" "/security?historyBack=1"
), ),
...safety.map(computeTileCard), ...security.map(computeTileCard),
], ],
}); });
} }

View File

@@ -1,7 +1,11 @@
import { ReactiveElement } from "lit"; import { ReactiveElement } from "lit";
import { customElement } from "lit/decorators"; import { customElement } from "lit/decorators";
import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; import { isComponentLoaded } from "../../../../common/config/is_component_loaded";
import { generateEntityFilter } from "../../../../common/entity/entity_filter"; import {
findEntities,
generateEntityFilter,
} from "../../../../common/entity/entity_filter";
import { floorDefaultIcon } from "../../../../components/ha-floor-icon";
import type { AreaRegistryEntry } from "../../../../data/area_registry"; import type { AreaRegistryEntry } from "../../../../data/area_registry";
import { getEnergyPreferences } from "../../../../data/energy"; import { getEnergyPreferences } from "../../../../data/energy";
import type { LovelaceCardConfig } from "../../../../data/lovelace/config/card"; import type { LovelaceCardConfig } from "../../../../data/lovelace/config/card";
@@ -21,7 +25,7 @@ import type {
import { getAreas, getFloors } from "../areas/helpers/areas-strategy-helper"; import { getAreas, getFloors } from "../areas/helpers/areas-strategy-helper";
import type { CommonControlSectionStrategyConfig } from "../usage_prediction/common-controls-section-strategy"; import type { CommonControlSectionStrategyConfig } from "../usage_prediction/common-controls-section-strategy";
import { getHomeStructure } from "./helpers/home-structure"; import { getHomeStructure } from "./helpers/home-structure";
import { floorDefaultIcon } from "../../../../components/ha-floor-icon"; import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries";
export interface HomeMainViewStrategyConfig { export interface HomeMainViewStrategyConfig {
type: "home-main"; type: "home-main";
@@ -144,15 +148,33 @@ export class HomeMainViewStrategy extends ReactiveElement {
column_span: maxColumns, column_span: maxColumns,
} as LovelaceStrategySectionConfig; } as LovelaceStrategySectionConfig;
const summarySection: LovelaceSectionConfig = { const allEntities = Object.keys(hass.states);
type: "grid",
column_span: maxColumns, const mediaPlayerFilter = HOME_SUMMARIES_FILTERS.media_players.map(
cards: [ (filter) => generateEntityFilter(hass, filter)
{ );
type: "heading",
heading: hass.localize("ui.panel.lovelace.strategy.home.summaries"), const lightsFilters = HOME_SUMMARIES_FILTERS.light.map((filter) =>
}, generateEntityFilter(hass, filter)
{ );
const climateFilters = HOME_SUMMARIES_FILTERS.climate.map((filter) =>
generateEntityFilter(hass, filter)
);
const securityFilters = HOME_SUMMARIES_FILTERS.security.map((filter) =>
generateEntityFilter(hass, filter)
);
const hasLights = findEntities(allEntities, lightsFilters).length > 0;
const hasMediaPlayers =
findEntities(allEntities, mediaPlayerFilter).length > 0;
const hasClimate = findEntities(allEntities, climateFilters).length > 0;
const hasSecurity = findEntities(allEntities, securityFilters).length > 0;
const summaryCards: LovelaceCardConfig[] = [
hasLights &&
({
type: "home-summary", type: "home-summary",
summary: "light", summary: "light",
vertical: true, vertical: true,
@@ -164,8 +186,9 @@ export class HomeMainViewStrategy extends ReactiveElement {
rows: 2, rows: 2,
columns: 4, columns: 4,
}, },
} satisfies HomeSummaryCard, } satisfies HomeSummaryCard),
{ hasClimate &&
({
type: "home-summary", type: "home-summary",
summary: "climate", summary: "climate",
vertical: true, vertical: true,
@@ -177,21 +200,23 @@ export class HomeMainViewStrategy extends ReactiveElement {
rows: 2, rows: 2,
columns: 4, columns: 4,
}, },
} satisfies HomeSummaryCard, } satisfies HomeSummaryCard),
{ hasSecurity &&
({
type: "home-summary", type: "home-summary",
summary: "safety", summary: "security",
vertical: true, vertical: true,
tap_action: { tap_action: {
action: "navigate", action: "navigate",
navigation_path: "/safety?historyBack=1", navigation_path: "/security?historyBack=1",
}, },
grid_options: { grid_options: {
rows: 2, rows: 2,
columns: 4, columns: 4,
}, },
} satisfies HomeSummaryCard, } satisfies HomeSummaryCard),
{ hasMediaPlayers &&
({
type: "home-summary", type: "home-summary",
summary: "media_players", summary: "media_players",
vertical: true, vertical: true,
@@ -203,10 +228,25 @@ export class HomeMainViewStrategy extends ReactiveElement {
rows: 2, rows: 2,
columns: 4, columns: 4,
}, },
} satisfies HomeSummaryCard, } satisfies HomeSummaryCard),
], ].filter(Boolean) as LovelaceCardConfig[];
const summarySection: LovelaceSectionConfig = {
type: "grid",
column_span: maxColumns,
cards: [],
}; };
if (summaryCards.length) {
summarySection.cards!.push(
{
type: "heading",
heading: hass.localize("ui.panel.lovelace.strategy.home.summaries"),
},
...summaryCards
);
}
const weatherFilter = generateEntityFilter(hass, { const weatherFilter = generateEntityFilter(hass, {
domain: "weather", domain: "weather",
entity_category: "none", entity_category: "none",
@@ -262,7 +302,7 @@ export class HomeMainViewStrategy extends ReactiveElement {
[ [
favoriteSection.cards && favoriteSection, favoriteSection.cards && favoriteSection,
commonControlsSection, commonControlsSection,
summarySection, summarySection.cards && summarySection,
...floorsSections, ...floorsSections,
widgetSection.cards && widgetSection, widgetSection.cards && widgetSection,
] satisfies (LovelaceSectionRawConfig | undefined)[] ] satisfies (LovelaceSectionRawConfig | undefined)[]

View File

@@ -59,6 +59,26 @@ const processAreasForMediaPlayers = (
return cards; return cards;
}; };
const processUnassignedEntities = (
hass: HomeAssistant,
entities: string[]
): LovelaceCardConfig[] => {
const unassignedFilter = generateEntityFilter(hass, {
area: null,
});
const unassignedEntities = entities.filter(unassignedFilter);
const areaCards: LovelaceCardConfig[] = [];
for (const entityId of unassignedEntities) {
areaCards.push({
type: "media-control",
entity: entityId,
} satisfies MediaControlCardConfig);
}
return areaCards;
};
@customElement("home-media-players-view-strategy") @customElement("home-media-players-view-strategy")
export class HomeMMediaPlayersViewStrategy extends ReactiveElement { export class HomeMMediaPlayersViewStrategy extends ReactiveElement {
static async generate( static async generate(
@@ -134,10 +154,35 @@ export class HomeMMediaPlayersViewStrategy extends ReactiveElement {
} }
} }
// Process unassigned entities
const unassignedCards = processUnassignedEntities(hass, entities);
if (unassignedCards.length > 0) {
const section: LovelaceSectionRawConfig = {
type: "grid",
column_span: 2,
cards: [
{
type: "heading",
heading:
sections.length > 0
? hass.localize(
"ui.panel.lovelace.strategy.home_media_players.other_media_players"
)
: hass.localize(
"ui.panel.lovelace.strategy.home_media_players.media_players"
),
},
...unassignedCards,
],
};
sections.push(section);
}
return { return {
type: "sections", type: "sections",
max_columns: 2, max_columns: 2,
sections: sections || [], sections: sections,
}; };
} }
} }

View File

@@ -109,6 +109,7 @@ export class HUIViewBackground extends LitElement {
protected willUpdate(changedProperties: PropertyValues<this>) { protected willUpdate(changedProperties: PropertyValues<this>) {
super.willUpdate(changedProperties); super.willUpdate(changedProperties);
let applyTheme = false;
if (changedProperties.has("hass") && this.hass) { if (changedProperties.has("hass") && this.hass) {
const oldHass = changedProperties.get("hass"); const oldHass = changedProperties.get("hass");
if ( if (
@@ -116,16 +117,18 @@ export class HUIViewBackground extends LitElement {
this.hass.themes !== oldHass.themes || this.hass.themes !== oldHass.themes ||
this.hass.selectedTheme !== oldHass.selectedTheme this.hass.selectedTheme !== oldHass.selectedTheme
) { ) {
this._applyTheme(); applyTheme = true;
return;
} }
} }
if (changedProperties.has("background")) { if (changedProperties.has("background")) {
this._applyTheme(); applyTheme = true;
this._fetchMedia(); this._fetchMedia();
} }
if (changedProperties.has("resolvedImage")) { if (changedProperties.has("resolvedImage")) {
applyTheme = true;
}
if (applyTheme) {
this._applyTheme(); this._applyTheme();
} }
} }

View File

@@ -1,28 +1,27 @@
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit"; import type { CSSResultGroup, PropertyValues } from "lit";
import { LitElement, css, html } from "lit"; import { LitElement, css, html, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { goBack } from "../../common/navigate"; import { goBack } from "../../common/navigate";
import { debounce } from "../../common/util/debounce";
import { deepEqual } from "../../common/util/deep-equal";
import "../../components/ha-icon-button-arrow-prev"; import "../../components/ha-icon-button-arrow-prev";
import "../../components/ha-menu-button"; import "../../components/ha-menu-button";
import type { LovelaceConfig } from "../../data/lovelace/config/types"; import type { LovelaceStrategyViewConfig } from "../../data/lovelace/config/view";
import { haStyle } from "../../resources/styles"; import { haStyle } from "../../resources/styles";
import type { HomeAssistant } from "../../types"; import type { HomeAssistant } from "../../types";
import { generateLovelaceViewStrategy } from "../lovelace/strategies/get-strategy";
import type { Lovelace } from "../lovelace/types"; import type { Lovelace } from "../lovelace/types";
import "../lovelace/views/hui-view"; import "../lovelace/views/hui-view";
import "../lovelace/views/hui-view-container"; import "../lovelace/views/hui-view-container";
const SAFETY_LOVELACE_CONFIG: LovelaceConfig = { const SECURITY_LOVELACE_VIEW_CONFIG: LovelaceStrategyViewConfig = {
views: [ strategy: {
{ type: "security",
strategy: { },
type: "safety",
},
},
],
}; };
@customElement("ha-panel-safety") @customElement("ha-panel-security")
class PanelSafety extends LitElement { class PanelSecurity extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property({ type: Boolean, reflect: true }) public narrow = false; @property({ type: Boolean, reflect: true }) public narrow = false;
@@ -34,62 +33,120 @@ class PanelSafety extends LitElement {
@state() private _searchParms = new URLSearchParams(window.location.search); @state() private _searchParms = new URLSearchParams(window.location.search);
public willUpdate(changedProps: PropertyValues) { public willUpdate(changedProps: PropertyValues) {
super.willUpdate(changedProps);
// Initial setup
if (!this.hasUpdated) { if (!this.hasUpdated) {
this.hass.loadFragmentTranslation("lovelace"); this.hass.loadFragmentTranslation("lovelace");
this._setLovelace();
return;
} }
if (!changedProps.has("hass")) { if (!changedProps.has("hass")) {
return; return;
} }
const oldHass = changedProps.get("hass") as this["hass"]; const oldHass = changedProps.get("hass") as this["hass"];
if (oldHass?.locale !== this.hass.locale) { if (oldHass && oldHass.localize !== this.hass.localize) {
this._setLovelace(); this._setLovelace();
return;
}
if (oldHass && this.hass) {
// If the entity registry changed, ask the user if they want to refresh the config
if (
oldHass.entities !== this.hass.entities ||
oldHass.devices !== this.hass.devices ||
oldHass.areas !== this.hass.areas ||
oldHass.floors !== this.hass.floors
) {
if (this.hass.config.state === "RUNNING") {
this._debounceRegistriesChanged();
return;
}
}
// If ha started, refresh the config
if (
this.hass.config.state === "RUNNING" &&
oldHass.config.state !== "RUNNING"
) {
this._setLovelace();
}
} }
} }
private _debounceRegistriesChanged = debounce(
() => this._registriesChanged(),
200
);
private _registriesChanged = async () => {
this._setLovelace();
};
private _back(ev) { private _back(ev) {
ev.stopPropagation(); ev.stopPropagation();
goBack(); goBack();
} }
protected render(): TemplateResult { protected render() {
return html` return html`
<div class="header"> <div class="header">
<div class="toolbar"> <div class="toolbar">
${this._searchParms.has("historyBack") ${
? html` this._searchParms.has("historyBack")
<ha-icon-button-arrow-prev ? html`
@click=${this._back} <ha-icon-button-arrow-prev
slot="navigationIcon" @click=${this._back}
></ha-icon-button-arrow-prev> slot="navigationIcon"
` ></ha-icon-button-arrow-prev>
: html` `
<ha-menu-button : html`
slot="navigationIcon" <ha-menu-button
.hass=${this.hass} slot="navigationIcon"
.narrow=${this.narrow} .hass=${this.hass}
></ha-menu-button> .narrow=${this.narrow}
`} ></ha-menu-button>
<div class="main-title">${this.hass.localize("panel.safety")}</div> `
}
<div class="main-title">${this.hass.localize("panel.security")}</div>
</div> </div>
</div> </div>
${
<hui-view-container .hass=${this.hass}> this._lovelace
<hui-view ? html`
.hass=${this.hass} <hui-view-container .hass=${this.hass}>
.narrow=${this.narrow} <hui-view
.lovelace=${this._lovelace} .hass=${this.hass}
.index=${this._viewIndex} .narrow=${this.narrow}
></hui-view> .lovelace=${this._lovelace}
.index=${this._viewIndex}
></hui-view
></hui-view-container>
`
: nothing
}
</hui-view-container> </hui-view-container>
`; `;
} }
private _setLovelace() { private async _setLovelace() {
const viewConfig = await generateLovelaceViewStrategy(
SECURITY_LOVELACE_VIEW_CONFIG,
this.hass
);
const config = { views: [viewConfig] };
const rawConfig = { views: [SECURITY_LOVELACE_VIEW_CONFIG] };
if (deepEqual(config, this._lovelace?.config)) {
return;
}
this._lovelace = { this._lovelace = {
config: SAFETY_LOVELACE_CONFIG, config: config,
rawConfig: SAFETY_LOVELACE_CONFIG, rawConfig: rawConfig,
editMode: false, editMode: false,
urlPath: "safety", urlPath: "security",
mode: "generated", mode: "generated",
locale: this.hass.locale, locale: this.hass.locale,
enableFullEditMode: () => undefined, enableFullEditMode: () => undefined,
@@ -191,6 +248,6 @@ class PanelSafety extends LitElement {
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
"ha-panel-safety": PanelSafety; "ha-panel-security": PanelSecurity;
} }
} }

View File

@@ -17,11 +17,11 @@ import {
} from "../../lovelace/strategies/areas/helpers/areas-strategy-helper"; } from "../../lovelace/strategies/areas/helpers/areas-strategy-helper";
import { getHomeStructure } from "../../lovelace/strategies/home/helpers/home-structure"; import { getHomeStructure } from "../../lovelace/strategies/home/helpers/home-structure";
export interface SafetyViewStrategyConfig { export interface SecurityViewStrategyConfig {
type: "safety"; type: "security";
} }
export const safetyEntityFilters: EntityFilter[] = [ export const securityEntityFilters: EntityFilter[] = [
{ {
domain: "camera", domain: "camera",
entity_category: "none", entity_category: "none",
@@ -67,7 +67,7 @@ export const safetyEntityFilters: EntityFilter[] = [
}, },
]; ];
const processAreasForSafety = ( const processAreasForSecurity = (
areaIds: string[], areaIds: string[],
hass: HomeAssistant, hass: HomeAssistant,
entities: string[] entities: string[]
@@ -81,12 +81,12 @@ const processAreasForSafety = (
const areaFilter = generateEntityFilter(hass, { const areaFilter = generateEntityFilter(hass, {
area: area.area_id, area: area.area_id,
}); });
const areaSafetyEntities = entities.filter(areaFilter); const areaSecurityEntities = entities.filter(areaFilter);
const areaCards: LovelaceCardConfig[] = []; const areaCards: LovelaceCardConfig[] = [];
const computeTileCard = computeAreaTileCardConfig(hass, "", false); const computeTileCard = computeAreaTileCardConfig(hass, "", false);
for (const entityId of areaSafetyEntities) { for (const entityId of areaSecurityEntities) {
areaCards.push(computeTileCard(entityId)); areaCards.push(computeTileCard(entityId));
} }
@@ -103,10 +103,28 @@ const processAreasForSafety = (
return cards; return cards;
}; };
@customElement("safety-view-strategy") const processUnassignedEntities = (
export class SafetyViewStrategy extends ReactiveElement { hass: HomeAssistant,
entities: string[]
): LovelaceCardConfig[] => {
const unassignedFilter = generateEntityFilter(hass, {
area: null,
});
const unassignedLights = entities.filter(unassignedFilter);
const areaCards: LovelaceCardConfig[] = [];
const computeTileCard = computeAreaTileCardConfig(hass, "", false);
for (const entityId of unassignedLights) {
areaCards.push(computeTileCard(entityId));
}
return areaCards;
};
@customElement("security-view-strategy")
export class SecurityViewStrategy extends ReactiveElement {
static async generate( static async generate(
_config: SafetyViewStrategyConfig, _config: SecurityViewStrategyConfig,
hass: HomeAssistant hass: HomeAssistant
): Promise<LovelaceViewConfig> { ): Promise<LovelaceViewConfig> {
const areas = getAreas(hass.areas); const areas = getAreas(hass.areas);
@@ -117,11 +135,11 @@ export class SafetyViewStrategy extends ReactiveElement {
const allEntities = Object.keys(hass.states); const allEntities = Object.keys(hass.states);
const safetyFilters = safetyEntityFilters.map((filter) => const securityFilters = securityEntityFilters.map((filter) =>
generateEntityFilter(hass, filter) generateEntityFilter(hass, filter)
); );
const entities = findEntities(allEntities, safetyFilters); const entities = findEntities(allEntities, securityFilters);
const floorCount = home.floors.length + (home.areas.length ? 1 : 0); const floorCount = home.floors.length + (home.areas.length ? 1 : 0);
@@ -146,7 +164,7 @@ export class SafetyViewStrategy extends ReactiveElement {
], ],
}; };
const areaCards = processAreasForSafety(areaIds, hass, entities); const areaCards = processAreasForSecurity(areaIds, hass, entities);
if (areaCards.length > 0) { if (areaCards.length > 0) {
section.cards!.push(...areaCards); section.cards!.push(...areaCards);
@@ -170,7 +188,7 @@ export class SafetyViewStrategy extends ReactiveElement {
], ],
}; };
const areaCards = processAreasForSafety(home.areas, hass, entities); const areaCards = processAreasForSecurity(home.areas, hass, entities);
if (areaCards.length > 0) { if (areaCards.length > 0) {
section.cards!.push(...areaCards); section.cards!.push(...areaCards);
@@ -178,16 +196,39 @@ export class SafetyViewStrategy extends ReactiveElement {
} }
} }
// Process unassigned entities
const unassignedCards = processUnassignedEntities(hass, entities);
if (unassignedCards.length > 0) {
const section: LovelaceSectionRawConfig = {
type: "grid",
column_span: 2,
cards: [
{
type: "heading",
heading:
sections.length > 0
? hass.localize(
"ui.panel.lovelace.strategy.security.other_devices"
)
: hass.localize("ui.panel.lovelace.strategy.security.devices"),
},
...unassignedCards,
],
};
sections.push(section);
}
return { return {
type: "sections", type: "sections",
max_columns: 2, max_columns: 2,
sections: sections || [], sections: sections,
}; };
} }
} }
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
"safety-view-strategy": SafetyViewStrategy; "security-view-strategy": SecurityViewStrategy;
} }
} }

View File

@@ -12,7 +12,7 @@
"media_browser": "Media", "media_browser": "Media",
"profile": "Profile", "profile": "Profile",
"light": "Lights", "light": "Lights",
"safety": "Safety", "security": "Security",
"climate": "Climate" "climate": "Climate"
}, },
"state": { "state": {
@@ -695,6 +695,11 @@
"remove_device_id": "Remove device", "remove_device_id": "Remove device",
"remove_entity_id": "Remove entity", "remove_entity_id": "Remove entity",
"remove_label_id": "Remove label", "remove_label_id": "Remove label",
"floor_not_found": "Floor not found",
"area_not_found": "Area not found",
"device_not_found": "Device not found",
"entity_not_found": "Entity not found",
"label_not_found": "Label not found",
"devices_count": "{count} {count, plural,\n one {device}\n other {devices}\n}", "devices_count": "{count} {count, plural,\n one {device}\n other {devices}\n}",
"entities_count": "{count} {count, plural,\n one {entity}\n other {entities}\n}", "entities_count": "{count} {count, plural,\n one {entity}\n other {entities}\n}",
"target_details": "Target details", "target_details": "Target details",
@@ -1706,6 +1711,14 @@
"update": "[%key:ui::panel::config::devices::update%]", "update": "[%key:ui::panel::config::devices::update%]",
"unknown_error": "[%key:ui::panel::config::devices::unknown_error%]" "unknown_error": "[%key:ui::panel::config::devices::unknown_error%]"
}, },
"label-detail": {
"new_label": "New label",
"name": "Name",
"icon": "Icon",
"color": "Color",
"description": "Description",
"required_error_msg": "[%key:ui::panel::config::zone::detail::required_error_msg%]"
},
"voice-settings": { "voice-settings": {
"expose_header": "Expose", "expose_header": "Expose",
"aliases_header": "Aliases", "aliases_header": "Aliases",
@@ -2406,18 +2419,7 @@
"introduction": "Labels can help you organize your areas, devices, and entities. They can be used to filter in the UI, or use them as a target in automations.", "introduction": "Labels can help you organize your areas, devices, and entities. They can be used to filter in the UI, or use them as a target in automations.",
"introduction2": "Go to the area, device, or entity you want to add a label to, and press the edit button to assign labels to them.", "introduction2": "Go to the area, device, or entity you want to add a label to, and press the edit button to assign labels to them.",
"confirm_remove_title": "Remove label?", "confirm_remove_title": "Remove label?",
"confirm_remove": "Are you sure you want to remove label {label}? It will be removed from all areas, devices, and entities.", "confirm_remove": "Are you sure you want to remove label {label}? It will be removed from all areas, devices, and entities."
"detail": {
"new_label": "New label",
"name": "Name",
"icon": "Icon",
"color": "Color",
"description": "Description",
"delete": "Delete",
"update": "Update",
"create": "Create",
"required_error_msg": "[%key:ui::panel::config::zone::detail::required_error_msg%]"
}
}, },
"areas": { "areas": {
"caption": "Areas", "caption": "Areas",
@@ -6948,6 +6950,22 @@
"common_controls": { "common_controls": {
"not_loaded": "Usage Prediction integration is not loaded.", "not_loaded": "Usage Prediction integration is not loaded.",
"no_data": "This place will soon fill up with the entities you use most often, based on your activity." "no_data": "This place will soon fill up with the entities you use most often, based on your activity."
},
"light": {
"lights": "Lights",
"other_lights": "Other lights"
},
"security": {
"devices": "Devices",
"other_devices": "Other devices"
},
"climate": {
"devices": "Devices",
"other_devices": "Other devices"
},
"home_media_players": {
"media_players": "Media players",
"other_media_players": "Other media players"
} }
}, },
"cards": { "cards": {
@@ -7651,8 +7669,7 @@
}, },
"logbook": { "logbook": {
"name": "Activity", "name": "Activity",
"description": "The Activity card shows a list of events for entities.", "description": "The Activity card shows a list of events for entities."
"state_filter": "State filter"
}, },
"history-graph": { "history-graph": {
"name": "History graph", "name": "History graph",

View File

@@ -388,4 +388,70 @@ describe("generateEntityFilter", () => {
expect(filter("light.no_area")).toBe(false); expect(filter("light.no_area")).toBe(false);
}); });
}); });
describe("null filtering", () => {
it("should filter entities with no area when null is used", () => {
const filter = generateEntityFilter(mockHass, { area: null });
expect(filter("light.no_area")).toBe(true);
expect(filter("light.living_room")).toBe(false);
});
it("should filter entities with specific area OR no area when null is in array", () => {
const filter = generateEntityFilter(mockHass, {
area: ["living_room", null],
});
expect(filter("light.living_room")).toBe(true);
expect(filter("sensor.temperature")).toBe(true);
expect(filter("light.no_area")).toBe(true);
expect(filter("switch.kitchen")).toBe(false);
});
it("should filter entities with no floor when null is used", () => {
const filter = generateEntityFilter(mockHass, { floor: null });
expect(filter("light.no_area")).toBe(true);
expect(filter("light.living_room")).toBe(false);
});
it("should filter entities with specific floor OR no floor", () => {
const filter = generateEntityFilter(mockHass, {
floor: ["main_floor", null],
});
expect(filter("light.living_room")).toBe(true);
expect(filter("switch.kitchen")).toBe(true);
expect(filter("light.no_area")).toBe(true);
expect(filter("light.bedroom")).toBe(false);
});
it("should filter entities with no device when null is used", () => {
const filter = generateEntityFilter(mockHass, { device: null });
expect(filter("light.living_room")).toBe(false);
expect(filter("light.no_area")).toBe(false);
});
it("should filter entities with specific device OR no device", () => {
const filter = generateEntityFilter(mockHass, {
device: ["device1", null],
});
expect(filter("light.living_room")).toBe(true);
expect(filter("switch.kitchen")).toBe(false);
});
it("should combine null filtering with other criteria", () => {
const filter = generateEntityFilter(mockHass, {
domain: "light",
area: ["living_room", null],
});
expect(filter("light.living_room")).toBe(true);
expect(filter("light.no_area")).toBe(true);
expect(filter("light.bedroom")).toBe(false);
expect(filter("sensor.temperature")).toBe(false);
});
});
}); });

View File

@@ -201,6 +201,7 @@ describe("getStates", () => {
"pm1", "pm1",
"pm10", "pm10",
"pm25", "pm25",
"pm4",
"power_factor", "power_factor",
"power", "power",
"pressure", "pressure",
@@ -215,7 +216,7 @@ describe("getStates", () => {
"volume_flow_rate", "volume_flow_rate",
]) ])
); );
expect(result.length).toBe(34); expect(result.length).toBe(35);
}); });
it("should return empty array for unknown attribute", () => { it("should return empty array for unknown attribute", () => {

260
yarn.lock
View File

@@ -3884,12 +3884,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@rsbuild/plugin-check-syntax@npm:1.5.0": "@rsbuild/plugin-check-syntax@npm:1.4.0":
version: 1.5.0 version: 1.4.0
resolution: "@rsbuild/plugin-check-syntax@npm:1.5.0" resolution: "@rsbuild/plugin-check-syntax@npm:1.4.0"
dependencies: dependencies:
acorn: "npm:^8.15.0" acorn: "npm:^8.15.0"
browserslist-to-es-version: "npm:^1.1.1" browserslist-to-es-version: "npm:^1.1.0"
htmlparser2: "npm:10.0.0" htmlparser2: "npm:10.0.0"
picocolors: "npm:^1.1.1" picocolors: "npm:^1.1.1"
source-map: "npm:^0.7.6" source-map: "npm:^0.7.6"
@@ -3898,86 +3898,85 @@ __metadata:
peerDependenciesMeta: peerDependenciesMeta:
"@rsbuild/core": "@rsbuild/core":
optional: true optional: true
checksum: 10/69f537d24aa298b9913c1e21378eded13a6deff21e597257bdfeb1ddbe42c711d21d068543190cdd2f6537531fea24feb84cf1637e2492c9fc5d2fcc1f9a53d6 checksum: 10/1e6ee37cc072bbf459ecd493a78cab2798e08c2e046828e0d93f618581738a4b7a6b6f3bf8b890a58b67b5a879d0a778810b33b834f75dadd89817cf16c73a38
languageName: node languageName: node
linkType: hard linkType: hard
"@rsdoctor/client@npm:1.3.6": "@rsdoctor/client@npm:1.3.4":
version: 1.3.6 version: 1.3.4
resolution: "@rsdoctor/client@npm:1.3.6" resolution: "@rsdoctor/client@npm:1.3.4"
checksum: 10/9c1207c7bbc0f7ba3ca100074703db07625997e9ed9649c4115ebbb7f3deb44605d0d0a508f20586a10a22ba006d022046cf55a82c19f2f9c599f5f8cd963379 checksum: 10/0f3d35ce16264c20294f317efc063153cc62b0d7d5f5f11aa444ace2cbf9617f1ea26828e1d8e5f7fe4ce6f6e276ea6cd8312fd4e4f3214a8a3c8d3728f0fc1f
languageName: node languageName: node
linkType: hard linkType: hard
"@rsdoctor/core@npm:1.3.6": "@rsdoctor/core@npm:1.3.4":
version: 1.3.6 version: 1.3.4
resolution: "@rsdoctor/core@npm:1.3.6" resolution: "@rsdoctor/core@npm:1.3.4"
dependencies: dependencies:
"@rsbuild/plugin-check-syntax": "npm:1.5.0" "@rsbuild/plugin-check-syntax": "npm:1.4.0"
"@rsdoctor/graph": "npm:1.3.6" "@rsdoctor/graph": "npm:1.3.4"
"@rsdoctor/sdk": "npm:1.3.6" "@rsdoctor/sdk": "npm:1.3.4"
"@rsdoctor/types": "npm:1.3.6" "@rsdoctor/types": "npm:1.3.4"
"@rsdoctor/utils": "npm:1.3.6" "@rsdoctor/utils": "npm:1.3.4"
browserslist-load-config: "npm:^1.0.1" browserslist-load-config: "npm:^1.0.1"
enhanced-resolve: "npm:5.12.0" enhanced-resolve: "npm:5.12.0"
es-toolkit: "npm:^1.41.0"
filesize: "npm:^10.1.6" filesize: "npm:^10.1.6"
fs-extra: "npm:^11.1.1" fs-extra: "npm:^11.1.1"
semver: "npm:^7.7.3" semver: "npm:^7.7.3"
source-map: "npm:^0.7.6" source-map: "npm:^0.7.6"
checksum: 10/e4501b8621b687a55e2cb8002286f3f84d950f2399721ecfc906be789d1554f946818d5c3ab6900a7d37725874f43632181cd6dd0ccd7d0e5f318ff30ad98055 checksum: 10/852f79ea59b6e2d6bcf0301136e3a9dd6f8acc2c011277128b791f8378a5d291e91c385ab691440bdba454f2130bde1097c3a3ba7eedf35e0a48cf1462d4d7c8
languageName: node languageName: node
linkType: hard linkType: hard
"@rsdoctor/graph@npm:1.3.6": "@rsdoctor/graph@npm:1.3.4":
version: 1.3.6 version: 1.3.4
resolution: "@rsdoctor/graph@npm:1.3.6" resolution: "@rsdoctor/graph@npm:1.3.4"
dependencies: dependencies:
"@rsdoctor/types": "npm:1.3.6" "@rsdoctor/types": "npm:1.3.4"
"@rsdoctor/utils": "npm:1.3.6" "@rsdoctor/utils": "npm:1.3.4"
es-toolkit: "npm:^1.41.0" es-toolkit: "npm:^1.40.0"
path-browserify: "npm:1.0.1" path-browserify: "npm:1.0.1"
source-map: "npm:^0.7.6" source-map: "npm:^0.7.6"
checksum: 10/64373a0cae33687a65db1ed093a7e0713aec8f749131367474668d32e3e84dd3b9e14e5cf7b8268cc7bff31ba8f6288515cc63ecb1804b25816e7b8483134df3 checksum: 10/77b50fa73e97c1bd01ef14134d5c81ba63dacba6c4119f712fff139c39adc787a71f4cca793565a7d4faa4d2dbdd869fa72e955632671121ece92ff945adfa83
languageName: node languageName: node
linkType: hard linkType: hard
"@rsdoctor/rspack-plugin@npm:1.3.6": "@rsdoctor/rspack-plugin@npm:1.3.4":
version: 1.3.6 version: 1.3.4
resolution: "@rsdoctor/rspack-plugin@npm:1.3.6" resolution: "@rsdoctor/rspack-plugin@npm:1.3.4"
dependencies: dependencies:
"@rsdoctor/core": "npm:1.3.6" "@rsdoctor/core": "npm:1.3.4"
"@rsdoctor/graph": "npm:1.3.6" "@rsdoctor/graph": "npm:1.3.4"
"@rsdoctor/sdk": "npm:1.3.6" "@rsdoctor/sdk": "npm:1.3.4"
"@rsdoctor/types": "npm:1.3.6" "@rsdoctor/types": "npm:1.3.4"
"@rsdoctor/utils": "npm:1.3.6" "@rsdoctor/utils": "npm:1.3.4"
peerDependencies: peerDependencies:
"@rspack/core": "*" "@rspack/core": "*"
peerDependenciesMeta: peerDependenciesMeta:
"@rspack/core": "@rspack/core":
optional: true optional: true
checksum: 10/7498e070668e57f747c786730618431732e4e74c4ba033cbe8b11f6b65974f41d426a31c0ceb847eb7ea886385004fa7a6e9e63ea30138dd2ff4c182cbf900c3 checksum: 10/bc09ae1f19c624011961f65e1185889420d60d8aea8ca404766368f60c9d4381bbff146d17e166db66d88080246a7a3029714285bac8f2a2d797130822e787d5
languageName: node languageName: node
linkType: hard linkType: hard
"@rsdoctor/sdk@npm:1.3.6": "@rsdoctor/sdk@npm:1.3.4":
version: 1.3.6 version: 1.3.4
resolution: "@rsdoctor/sdk@npm:1.3.6" resolution: "@rsdoctor/sdk@npm:1.3.4"
dependencies: dependencies:
"@rsdoctor/client": "npm:1.3.6" "@rsdoctor/client": "npm:1.3.4"
"@rsdoctor/graph": "npm:1.3.6" "@rsdoctor/graph": "npm:1.3.4"
"@rsdoctor/types": "npm:1.3.6" "@rsdoctor/types": "npm:1.3.4"
"@rsdoctor/utils": "npm:1.3.6" "@rsdoctor/utils": "npm:1.3.4"
safer-buffer: "npm:2.1.2" safer-buffer: "npm:2.1.2"
socket.io: "npm:4.8.1" socket.io: "npm:4.8.1"
tapable: "npm:2.2.3" tapable: "npm:2.2.3"
checksum: 10/b1a78b36843fdb9596d42a67e12d25fcf2ba03e26793483d6bd50de18ed9a20df5891b5772b456cdf8d73c920b1f42d5e8c90c03def813ae8d8b0ca0e7ba1113 checksum: 10/9e57d1c9f51c4404a6c262c2f4602c19c6d3a9e467ca63456a81d8f614690d85a2574d5e936f03ca5672813a61544f02ca3c4e5f10eb5833f0116f8d2214572b
languageName: node languageName: node
linkType: hard linkType: hard
"@rsdoctor/types@npm:1.3.6": "@rsdoctor/types@npm:1.3.4":
version: 1.3.6 version: 1.3.4
resolution: "@rsdoctor/types@npm:1.3.6" resolution: "@rsdoctor/types@npm:1.3.4"
dependencies: dependencies:
"@types/connect": "npm:3.4.38" "@types/connect": "npm:3.4.38"
"@types/estree": "npm:1.0.5" "@types/estree": "npm:1.0.5"
@@ -3991,16 +3990,16 @@ __metadata:
optional: true optional: true
webpack: webpack:
optional: true optional: true
checksum: 10/090c5872cb7c04c83ed134ec47fdf673777056e80041860f21e36c4f7c506f019136a834d59ed3b84db8d8df615300e331060234dc48b71af5acab287352adc3 checksum: 10/56ce0af51c6d78eaac6fa6236dba1c5753b52dd021f8ffc4d3fe40d7f52f079ecec7e2c247ac3ca6e44d8a6f274bb20b9c7310baa9ce7bf7e60d8ee16ec8c0c4
languageName: node languageName: node
linkType: hard linkType: hard
"@rsdoctor/utils@npm:1.3.6": "@rsdoctor/utils@npm:1.3.4":
version: 1.3.6 version: 1.3.4
resolution: "@rsdoctor/utils@npm:1.3.6" resolution: "@rsdoctor/utils@npm:1.3.4"
dependencies: dependencies:
"@babel/code-frame": "npm:7.26.2" "@babel/code-frame": "npm:7.26.2"
"@rsdoctor/types": "npm:1.3.6" "@rsdoctor/types": "npm:1.3.4"
"@types/estree": "npm:1.0.5" "@types/estree": "npm:1.0.5"
acorn: "npm:^8.10.0" acorn: "npm:^8.10.0"
acorn-import-attributes: "npm:^1.9.5" acorn-import-attributes: "npm:^1.9.5"
@@ -4014,7 +4013,7 @@ __metadata:
picocolors: "npm:^1.1.1" picocolors: "npm:^1.1.1"
rslog: "npm:^1.2.11" rslog: "npm:^1.2.11"
strip-ansi: "npm:^6.0.1" strip-ansi: "npm:^6.0.1"
checksum: 10/cb3b6e0c6ea64d6d7657a6682c1c295a4d0a787af7292fe4e7da46ef064d8ca843c7a65b9e0014a9d77053aeaf3481f16776acec3963ac6a8dcc4ba1c4bf5a17 checksum: 10/04b72e7ab1b63cad77ef83a468cb5c5b1468662dd29d03fbae7ef16aa81d3d91b54958d8630ee53655b794c32b12effb5ff3162cc309174c5ec784373d3f0560
languageName: node languageName: node
linkType: hard linkType: hard
@@ -5377,12 +5376,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/coverage-v8@npm:4.0.4": "@vitest/coverage-v8@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/coverage-v8@npm:4.0.4" resolution: "@vitest/coverage-v8@npm:4.0.3"
dependencies: dependencies:
"@bcoe/v8-coverage": "npm:^1.0.2" "@bcoe/v8-coverage": "npm:^1.0.2"
"@vitest/utils": "npm:4.0.4" "@vitest/utils": "npm:4.0.3"
ast-v8-to-istanbul: "npm:^0.3.5" ast-v8-to-istanbul: "npm:^0.3.5"
debug: "npm:^4.4.3" debug: "npm:^4.4.3"
istanbul-lib-coverage: "npm:^3.2.2" istanbul-lib-coverage: "npm:^3.2.2"
@@ -5393,34 +5392,34 @@ __metadata:
std-env: "npm:^3.9.0" std-env: "npm:^3.9.0"
tinyrainbow: "npm:^3.0.3" tinyrainbow: "npm:^3.0.3"
peerDependencies: peerDependencies:
"@vitest/browser": 4.0.4 "@vitest/browser": 4.0.3
vitest: 4.0.4 vitest: 4.0.3
peerDependenciesMeta: peerDependenciesMeta:
"@vitest/browser": "@vitest/browser":
optional: true optional: true
checksum: 10/9aaab295ae81da2be090973173922e3db2822725d0fbe27e8084908018e95cc6666259c8cc4b6bab14bd40bb9365072e41c7ae64c4d2a28672ad23f7743cec29 checksum: 10/8051dc457f74f9dbd912be9805fc3c6c1a965e3c86d88a6f4b2d4b7e38511dcce689447adb92235c33bec8fddcd0ede8e81f6bdf33eedc9ff00070b28a474093
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/expect@npm:4.0.4": "@vitest/expect@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/expect@npm:4.0.4" resolution: "@vitest/expect@npm:4.0.3"
dependencies: dependencies:
"@standard-schema/spec": "npm:^1.0.0" "@standard-schema/spec": "npm:^1.0.0"
"@types/chai": "npm:^5.2.2" "@types/chai": "npm:^5.2.2"
"@vitest/spy": "npm:4.0.4" "@vitest/spy": "npm:4.0.3"
"@vitest/utils": "npm:4.0.4" "@vitest/utils": "npm:4.0.3"
chai: "npm:^6.0.1" chai: "npm:^6.0.1"
tinyrainbow: "npm:^3.0.3" tinyrainbow: "npm:^3.0.3"
checksum: 10/7d6f4e501c5b84c63fd99259a2b0000b81b075fd62c1a4ff479c50136d46d6cf90bcdd514f6304bf972fbba148949fda23ebd2926fa26f0fd428f1010f1cff63 checksum: 10/663936d8f3abd91cb9725196ec542d109d7c64ddcdb6a483d89c9d67aa78a8ddd4468348c54b69f9c801fc3add9a8ae35dd0491c9f2bd19ec17b9b7a9ebf0d82
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/mocker@npm:4.0.4": "@vitest/mocker@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/mocker@npm:4.0.4" resolution: "@vitest/mocker@npm:4.0.3"
dependencies: dependencies:
"@vitest/spy": "npm:4.0.4" "@vitest/spy": "npm:4.0.3"
estree-walker: "npm:^3.0.3" estree-walker: "npm:^3.0.3"
magic-string: "npm:^0.30.19" magic-string: "npm:^0.30.19"
peerDependencies: peerDependencies:
@@ -5431,54 +5430,54 @@ __metadata:
optional: true optional: true
vite: vite:
optional: true optional: true
checksum: 10/070ddbd7f9907482aa1812e01d13ff66cea540479435a857072fc7528f4b583d62f0600eed112b5780e9698812c944b679fc959e764670de23621eba9be9e177 checksum: 10/933cab25563f68335a9871a6deba8f886f6be155c4a2146ee2b3b625578a0b4e068a4a26cf1a8d4ba3b5eb34771276f0365e51320fd06ad3f3f19163c5521d77
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/pretty-format@npm:4.0.4": "@vitest/pretty-format@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/pretty-format@npm:4.0.4" resolution: "@vitest/pretty-format@npm:4.0.3"
dependencies: dependencies:
tinyrainbow: "npm:^3.0.3" tinyrainbow: "npm:^3.0.3"
checksum: 10/64b0430012f8c34748a39dd1ea061f51d17053086d961830e93a4083b7cda50d822d6db8154398d7f800e15e1efc45c6460d7c1c5f06e21f09a282663824b9c9 checksum: 10/1b1197e53e5bcf9f77c842005ff11068f754b87286c6a7669b78c08a05bdbaa5cf4c7326c3b13347b02341b084bf97992c3fe89ea98fb77019e28fd96bc4c5b4
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/runner@npm:4.0.4": "@vitest/runner@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/runner@npm:4.0.4" resolution: "@vitest/runner@npm:4.0.3"
dependencies: dependencies:
"@vitest/utils": "npm:4.0.4" "@vitest/utils": "npm:4.0.3"
pathe: "npm:^2.0.3" pathe: "npm:^2.0.3"
checksum: 10/3bd7e8944d8770ae7dd7457fb83751def5cb4834766cb86b7231cc0fd77d4e889b5ec6da70ae82e06902b19c216f114a5a670e4422ba2db8384dee09dc24b832 checksum: 10/a028898045cedac1939cc1adeff8fe36cbba2714d08e8524c8028b6fef7d617440bf0dfd72f1e264e8bff876979c49923bf268cb5920305a0ca9562a8318a80c
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/snapshot@npm:4.0.4": "@vitest/snapshot@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/snapshot@npm:4.0.4" resolution: "@vitest/snapshot@npm:4.0.3"
dependencies: dependencies:
"@vitest/pretty-format": "npm:4.0.4" "@vitest/pretty-format": "npm:4.0.3"
magic-string: "npm:^0.30.19" magic-string: "npm:^0.30.19"
pathe: "npm:^2.0.3" pathe: "npm:^2.0.3"
checksum: 10/dba29abb40e8a4e8931a9522076f0884a579280c440d1e7591c32c4f8d75366b18e3f78920eed13337909384767d0403d15f384275f22d7c0bc5c36a0c4f5482 checksum: 10/38d0707ad66b33987c4066ee713f22d4535712ca016cece007c84736fa543d3ad3a314e759632b63e369e6a5454b03b142f66f5d661ac81ce7c4f1d6f6d325f4
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/spy@npm:4.0.4": "@vitest/spy@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/spy@npm:4.0.4" resolution: "@vitest/spy@npm:4.0.3"
checksum: 10/f3bca9c53840c6f271d676a5b7a06535eb4a80e4b2e52e179ff56cb53f7f725ba1c683cb13d2ef1283057c09bf260634b9b9b318bd2a1755853c067bc9a0dd6a checksum: 10/4fc8e3aae425fdbbe96126291079f67f1e6be9545ffbaab7a31de8d6e6825b115eb3fafbf24167eab91dbbb4ed6fcd120c387116f181de1e3369e8d5fdd75f17
languageName: node languageName: node
linkType: hard linkType: hard
"@vitest/utils@npm:4.0.4": "@vitest/utils@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "@vitest/utils@npm:4.0.4" resolution: "@vitest/utils@npm:4.0.3"
dependencies: dependencies:
"@vitest/pretty-format": "npm:4.0.4" "@vitest/pretty-format": "npm:4.0.3"
tinyrainbow: "npm:^3.0.3" tinyrainbow: "npm:^3.0.3"
checksum: 10/032aa6fad679efe270015bd0ceec55915b3ff4597f5e0b4ee9ae2ac54d5e8a2f903ef64533cc73f05264d8959c01104a32283c2b0298f4e903a003c9bf427514 checksum: 10/d4ddb293e908d43b954c5e41f351a61f719e30e9ea058e47af5b18389d74cb073ea1638ab28dbbd5b365ed31a21577bb090b8a3594292c59df18798fd292f002
languageName: node languageName: node
linkType: hard linkType: hard
@@ -6299,12 +6298,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"browserslist-to-es-version@npm:^1.1.1": "browserslist-to-es-version@npm:^1.1.0":
version: 1.2.0 version: 1.1.1
resolution: "browserslist-to-es-version@npm:1.2.0" resolution: "browserslist-to-es-version@npm:1.1.1"
dependencies: dependencies:
browserslist: "npm:^4.26.2" browserslist: "npm:^4.25.1"
checksum: 10/a9af676f4b736fc17cd42cbc98edc735e7f1e775ccb71443afc5ec7184203669f4c6c37ec2d73964c598d7f8fa42ae6ce2ec0e9a9c64fcb1bc297110dbfbd0c9 checksum: 10/efce2f27e67bda030ee3957f6df5aaa8594ee5cf017d3567f1226f6abcea7c3840c1ba73105b6bd661c5f57339e44c6819804609e1f064cfdfb8d53894a9f777
languageName: node languageName: node
linkType: hard linkType: hard
@@ -6326,7 +6325,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"browserslist@npm:^4.24.0, browserslist@npm:^4.25.3, browserslist@npm:^4.26.2": "browserslist@npm:^4.24.0, browserslist@npm:^4.25.1, browserslist@npm:^4.25.3":
version: 4.27.0 version: 4.27.0
resolution: "browserslist@npm:4.27.0" resolution: "browserslist@npm:4.27.0"
dependencies: dependencies:
@@ -7745,7 +7744,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"es-toolkit@npm:^1.41.0": "es-toolkit@npm:^1.40.0":
version: 1.41.0 version: 1.41.0
resolution: "es-toolkit@npm:1.41.0" resolution: "es-toolkit@npm:1.41.0"
dependenciesMeta: dependenciesMeta:
@@ -9272,7 +9271,7 @@ __metadata:
"@octokit/plugin-retry": "npm:8.0.2" "@octokit/plugin-retry": "npm:8.0.2"
"@octokit/rest": "npm:22.0.0" "@octokit/rest": "npm:22.0.0"
"@replit/codemirror-indentation-markers": "npm:6.5.3" "@replit/codemirror-indentation-markers": "npm:6.5.3"
"@rsdoctor/rspack-plugin": "npm:1.3.6" "@rsdoctor/rspack-plugin": "npm:1.3.4"
"@rspack/core": "npm:1.5.8" "@rspack/core": "npm:1.5.8"
"@rspack/dev-server": "npm:1.1.4" "@rspack/dev-server": "npm:1.1.4"
"@swc/helpers": "npm:0.5.17" "@swc/helpers": "npm:0.5.17"
@@ -9300,7 +9299,7 @@ __metadata:
"@vaadin/combo-box": "npm:24.9.2" "@vaadin/combo-box": "npm:24.9.2"
"@vaadin/vaadin-themable-mixin": "npm:24.9.2" "@vaadin/vaadin-themable-mixin": "npm:24.9.2"
"@vibrant/color": "npm:4.0.0" "@vibrant/color": "npm:4.0.0"
"@vitest/coverage-v8": "npm:4.0.4" "@vitest/coverage-v8": "npm:4.0.3"
"@vue/web-component-wrapper": "npm:1.3.0" "@vue/web-component-wrapper": "npm:1.3.0"
"@webcomponents/scoped-custom-element-registry": "npm:0.0.10" "@webcomponents/scoped-custom-element-registry": "npm:0.0.10"
"@webcomponents/webcomponentsjs": "npm:2.8.0" "@webcomponents/webcomponentsjs": "npm:2.8.0"
@@ -9346,7 +9345,7 @@ __metadata:
husky: "npm:9.1.7" husky: "npm:9.1.7"
idb-keyval: "npm:6.2.2" idb-keyval: "npm:6.2.2"
intl-messageformat: "npm:10.7.18" intl-messageformat: "npm:10.7.18"
js-yaml: "npm:4.1.0" js-yaml: "npm:4.1.1"
jsdom: "npm:27.0.1" jsdom: "npm:27.0.1"
jszip: "npm:3.10.1" jszip: "npm:3.10.1"
leaflet: "npm:1.9.4" leaflet: "npm:1.9.4"
@@ -9385,7 +9384,7 @@ __metadata:
typescript-eslint: "npm:8.46.2" typescript-eslint: "npm:8.46.2"
ua-parser-js: "npm:2.0.6" ua-parser-js: "npm:2.0.6"
vite-tsconfig-paths: "npm:5.1.4" vite-tsconfig-paths: "npm:5.1.4"
vitest: "npm:4.0.4" vitest: "npm:4.0.3"
vue: "npm:2.7.16" vue: "npm:2.7.16"
vue2-daterange-picker: "npm:0.6.8" vue2-daterange-picker: "npm:0.6.8"
webpack-stats-plugin: "npm:1.1.3" webpack-stats-plugin: "npm:1.1.3"
@@ -10416,14 +10415,14 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": "js-yaml@npm:4.1.1, js-yaml@npm:^4.1.0":
version: 4.1.0 version: 4.1.1
resolution: "js-yaml@npm:4.1.0" resolution: "js-yaml@npm:4.1.1"
dependencies: dependencies:
argparse: "npm:^2.0.1" argparse: "npm:^2.0.1"
bin: bin:
js-yaml: bin/js-yaml.js js-yaml: bin/js-yaml.js
checksum: 10/c138a34a3fd0d08ebaf71273ad4465569a483b8a639e0b118ff65698d257c2791d3199e3f303631f2cb98213fa7b5f5d6a4621fd0fff819421b990d30d967140 checksum: 10/a52d0519f0f4ef5b4adc1cde466cb54c50d56e2b4a983b9d5c9c0f2f99462047007a6274d7e95617a21d3c91fde3ee6115536ed70991cd645ba8521058b78f77
languageName: node languageName: node
linkType: hard linkType: hard
@@ -13844,7 +13843,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"tar@npm:7.5.1, tar@npm:^7.4.3": "tar@npm:7.5.1":
version: 7.5.1 version: 7.5.1
resolution: "tar@npm:7.5.1" resolution: "tar@npm:7.5.1"
dependencies: dependencies:
@@ -13857,6 +13856,19 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"tar@npm:^7.4.3":
version: 7.5.2
resolution: "tar@npm:7.5.2"
dependencies:
"@isaacs/fs-minipass": "npm:^4.0.0"
chownr: "npm:^3.0.0"
minipass: "npm:^7.1.2"
minizlib: "npm:^3.1.0"
yallist: "npm:^5.0.0"
checksum: 10/dbad9c9a07863cd1bdf8801d563b3280aa7dd0f4a6cead779ff7516d148dc80b4c04639ba732d47f91f04002f57e8c3c6573a717d649daecaac74ce71daa7ad3
languageName: node
linkType: hard
"teex@npm:^1.0.1": "teex@npm:^1.0.1":
version: 1.0.1 version: 1.0.1
resolution: "teex@npm:1.0.1" resolution: "teex@npm:1.0.1"
@@ -14767,17 +14779,17 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"vitest@npm:4.0.4": "vitest@npm:4.0.3":
version: 4.0.4 version: 4.0.3
resolution: "vitest@npm:4.0.4" resolution: "vitest@npm:4.0.3"
dependencies: dependencies:
"@vitest/expect": "npm:4.0.4" "@vitest/expect": "npm:4.0.3"
"@vitest/mocker": "npm:4.0.4" "@vitest/mocker": "npm:4.0.3"
"@vitest/pretty-format": "npm:4.0.4" "@vitest/pretty-format": "npm:4.0.3"
"@vitest/runner": "npm:4.0.4" "@vitest/runner": "npm:4.0.3"
"@vitest/snapshot": "npm:4.0.4" "@vitest/snapshot": "npm:4.0.3"
"@vitest/spy": "npm:4.0.4" "@vitest/spy": "npm:4.0.3"
"@vitest/utils": "npm:4.0.4" "@vitest/utils": "npm:4.0.3"
debug: "npm:^4.4.3" debug: "npm:^4.4.3"
es-module-lexer: "npm:^1.7.0" es-module-lexer: "npm:^1.7.0"
expect-type: "npm:^1.2.2" expect-type: "npm:^1.2.2"
@@ -14795,10 +14807,10 @@ __metadata:
"@edge-runtime/vm": "*" "@edge-runtime/vm": "*"
"@types/debug": ^4.1.12 "@types/debug": ^4.1.12
"@types/node": ^20.0.0 || ^22.0.0 || >=24.0.0 "@types/node": ^20.0.0 || ^22.0.0 || >=24.0.0
"@vitest/browser-playwright": 4.0.4 "@vitest/browser-playwright": 4.0.3
"@vitest/browser-preview": 4.0.4 "@vitest/browser-preview": 4.0.3
"@vitest/browser-webdriverio": 4.0.4 "@vitest/browser-webdriverio": 4.0.3
"@vitest/ui": 4.0.4 "@vitest/ui": 4.0.3
happy-dom: "*" happy-dom: "*"
jsdom: "*" jsdom: "*"
peerDependenciesMeta: peerDependenciesMeta:
@@ -14822,7 +14834,7 @@ __metadata:
optional: true optional: true
bin: bin:
vitest: vitest.mjs vitest: vitest.mjs
checksum: 10/5a7cd573e1a1daeaa7d874d9a676945aab67c1b5167119e903d50be33f3490f919ea575119efdc473a42d8c42b176bbbc31c12f3c7f1fdd2eb817cc8e162c10a checksum: 10/535ef75a39d5d3233eeb1050a09cd9b3c9353daad610a442aec16ef657887c16d4a6264d37a4181d487cd07cbb4b2e763ce74b1df037b2850a184983545f3db6
languageName: node languageName: node
linkType: hard linkType: hard