Compare commits

..

53 Commits

Author SHA1 Message Date
Petar Petrov
1a4a6e60fb clean up 2025-09-30 09:35:36 +03:00
Petar Petrov
d377275bff clean up 2025-09-30 08:50:41 +03:00
Petar Petrov
65d15da469 slots 2025-09-30 08:44:59 +03:00
Petar Petrov
903ab67604 Use hui-tile in hui-home-summary-card 2025-09-29 20:55:37 +03:00
Petar Petrov
948b020b7c Reusable hui-tile component 2025-09-29 20:49:54 +03:00
renovate[bot]
53be0a3fa2 Update dependency @rsdoctor/rspack-plugin to v1.3.0 (#27241)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-29 17:31:13 +02:00
renovate[bot]
d69c46c80c Update dependency @codemirror/autocomplete to v6.19.0 (#27242)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-29 17:30:42 +02:00
Paul Bottein
0c2a7bfed0 Replace legacy hass icons to mdi icons (#27244) 2025-09-29 17:30:20 +02:00
dependabot[bot]
afdd232e38 Bump home-assistant/wheels from 2025.07.0 to 2025.09.1 (#27239)
Bumps [home-assistant/wheels](https://github.com/home-assistant/wheels) from 2025.07.0 to 2025.09.1.
- [Release notes](https://github.com/home-assistant/wheels/releases)
- [Commits](https://github.com/home-assistant/wheels/compare/2025.07.0...2025.09.1)

---
updated-dependencies:
- dependency-name: home-assistant/wheels
  dependency-version: 2025.09.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-29 12:37:13 +02:00
dependabot[bot]
179751a135 Bump github/codeql-action from 3.30.3 to 3.30.5 (#27235)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.3 to 3.30.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](192325c861...3599b3baa1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-29 11:03:37 +03:00
dependabot[bot]
52f6024306 Bump actions/cache from 4.2.4 to 4.3.0 (#27236)
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.4 to 4.3.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](0400d5f644...0057852bfa)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-29 11:03:06 +03:00
Phil White
7c7a4e61f2 Add media playback badge for Area card (#26893) 2025-09-29 09:58:57 +02:00
Jan-Philipp Benecke
facce7b016 Add custom color token for control color (#27227) 2025-09-29 07:28:24 +00:00
Petar Petrov
e546cb3374 Make "loading next step" look like progress step in config flows (#27234) 2025-09-29 09:19:18 +02:00
Jan-Philipp Benecke
a0d2e7312b Adjust media player cover image sizes in more info for smaller screens (#27232)
Adjust media player cover image sizes for smaller screens
2025-09-29 08:30:12 +03:00
Jan-Philipp Benecke
c0a9dadcbe Implement core spacing tokens (#27226) 2025-09-29 08:28:24 +03:00
renovate[bot]
e1edf7fb98 Update dependency lint-staged to v16.2.1 (#27233)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-29 07:57:45 +03:00
Jan-Philipp Benecke
6d5c165bd2 Add tooltips for undo/redo in automation & script editors (#27224) 2025-09-28 13:35:48 +03:00
Simon Lamon
54177a16e9 Set explicit netlify version to fix workflows (#27229)
netlify set explicit version for fix
2025-09-28 13:34:18 +03:00
Paul Bottein
c814b8e888 Align dashboard data table with other data tables (#27206)
* Align dashboard data table with other data tables

* Update ha-config-lovelace-dashboards.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update ha-config-lovelace-dashboards.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-27 18:07:01 +03:00
renovate[bot]
33a0b32cc5 Update vaadinWebComponents monorepo to v24.9.1 (#27220)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-27 13:25:12 +02:00
renovate[bot]
7dae13bf57 Update dependency @rspack/core to v1.5.7 (#27219)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-27 13:24:59 +02:00
renovate[bot]
0a3fe6e0fb Update dependency tar to v7.5.1 (#27216) 2025-09-26 19:21:46 +02:00
Paul Bottein
e0348e4da7 Fix slider ticks support for number selector (#27211) 2025-09-26 15:35:01 +02:00
Aidan Timson
d53f3ec898 Add missing translations for thread config panel (#27210) 2025-09-26 14:09:11 +01:00
renovate[bot]
e422547d93 Update Yarn to v4.10.3 (#27209)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-26 15:33:12 +03:00
Paul Bottein
d91a3fbe85 Don't display negative durations in media player more info (#27212)
Don't display negative value in media player more info
2025-09-26 15:28:59 +03:00
Paul Bottein
01d7130f22 Fix try tts dialog max width (#27208) 2025-09-26 13:36:05 +02:00
Aidan Timson
c57851e4df Migrate hex color helper functions to culori (#27184) 2025-09-26 11:31:18 +02:00
Aidan Timson
6f1f13acb0 Migrate rgb color helper functions to culori (#27185) 2025-09-26 11:00:08 +02:00
Jan-Philipp Benecke
a8abd00809 Refactor media player slider to use slot for position and duration display (#27205)
* Refactor media player slider to use slot for position and duration display

* Fix variable naming
2025-09-26 06:33:56 +00:00
karwosts
e053978dbe Add dropdown mode to water heater operation feature (#27201) 2025-09-26 08:51:03 +03:00
karwosts
6e57f726a3 Add validation issues to energy diagnostic (#27203) 2025-09-26 08:48:21 +03:00
renovate[bot]
b7cabadbe1 Update dependency typescript-eslint to v8.44.1 (#27197) 2025-09-25 22:09:08 +02:00
Simon Lamon
d920217374 Fix typos in media player more info (#27198) 2025-09-25 19:02:26 +00:00
Jan-Philipp Benecke
1630263276 Round seconds in media player more info before formatting (#27196) 2025-09-25 20:47:40 +02:00
Paul Bottein
5680c742be Revert "Update dependency @types/chromecast-caf-receiver to v6.0.24" (#27188) 2025-09-25 17:48:23 +02:00
Paul Bottein
2aeb9cf0ef Revert "Update dependency @types/chromecast-caf-receiver to v6.0.24 (#26500)"
This reverts commit 4a3ed62583.
2025-09-25 17:47:59 +02:00
Paul Bottein
c9931b3a3c Disabled config badge (#27172)
* Add disabled option for badge

* Add disabled to struct
2025-09-25 17:45:06 +02:00
Paul Bottein
fbf7ebdfe4 Add icon option to common controls section strategy (#27180) 2025-09-25 17:23:54 +02:00
renovate[bot]
52ccb03de5 Update dependency hls.js to v1.6.13 (#27187)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 17:21:23 +02:00
Paul Bottein
900236ac07 Fix storage bar not displayed (#27183) 2025-09-25 15:56:26 +01:00
renovate[bot]
28940c930d Update dependency @codemirror/view to v6.38.3 (#27163)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 15:55:35 +01:00
Paul Bottein
e278b463fd Fix analytics switches (#27181) 2025-09-25 15:54:11 +01:00
renovate[bot]
db2acd4e39 Update dependency @rspack/core to v1.5.6 (#27177)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 13:10:01 +02:00
Wendelin
6dcc52cd44 Reduce default tab padding in tab-group (#27173) 2025-09-25 11:52:04 +01:00
Paul Bottein
981db50826 Smooth animation of the sidebar resizing handle (#27166) 2025-09-25 10:43:04 +02:00
Paul Bottein
09683863a7 Fix safe padding for bottom sheet and add scroll lock (#27165) 2025-09-25 10:41:05 +02:00
Norbert Rittel
8c78f931dc Use "Add (person)" instead of "New person" / "Create" (#27161)
* Update dialog-person-detail.ts

* Update en.json
2025-09-25 10:19:25 +02:00
renovate[bot]
40ce3c1e31 Update dependency lint-staged to v16.2.0 (#27164)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 10:13:06 +02:00
Paulus Schoutsen
e430a1b1be Avoid invalid entities in common controls (#27158) 2025-09-25 08:15:54 +03:00
renovate[bot]
a2c6116417 Update dependency tar to v7.4.4 (#27159)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-25 08:15:06 +03:00
Paul Bottein
3239273f3e Do not show error message when action has no response in dev tools (#27156) 2025-09-24 19:19:31 +02:00
130 changed files with 1405 additions and 1408 deletions

View File

@@ -37,7 +37,7 @@ jobs:
- name: Build resources - name: Build resources
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
- name: Setup lint cache - name: Setup lint cache
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with: with:
path: | path: |
node_modules/.cache/prettier node_modules/.cache/prettier

View File

@@ -36,14 +36,14 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3 uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3 uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
@@ -57,4 +57,4 @@ jobs:
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3 uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5

View File

@@ -75,7 +75,7 @@ jobs:
# home-assistant/wheels doesn't support SHA pinning # home-assistant/wheels doesn't support SHA pinning
- name: Build wheels - name: Build wheels
uses: home-assistant/wheels@2025.07.0 uses: home-assistant/wheels@2025.09.1
with: with:
abi: cp313 abi: cp313
tag: musllinux_1_2 tag: musllinux_1_2

File diff suppressed because one or more lines are too long

View File

@@ -6,4 +6,4 @@ enableGlobalCache: false
nodeLinker: node-modules nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.10.2.cjs yarnPath: .yarn/releases/yarn-4.10.3.cjs

View File

@@ -75,7 +75,7 @@ export const castDemoEntities: () => Entity[] = () =>
longitude: 4.8903147, longitude: 4.8903147,
radius: 100, radius: 100,
friendly_name: "Home", friendly_name: "Home",
icon: "hass:home", icon: "mdi:home",
}, },
}, },
"input_number.harmonyvolume": { "input_number.harmonyvolume": {
@@ -88,7 +88,7 @@ export const castDemoEntities: () => Entity[] = () =>
step: 1, step: 1,
mode: "slider", mode: "slider",
friendly_name: "Volume", friendly_name: "Volume",
icon: "hass:volume-high", icon: "mdi:volume-high",
}, },
}, },
"climate.upstairs": { "climate.upstairs": {

View File

@@ -56,7 +56,7 @@ export const castDemoLovelace: () => LovelaceConfig = () => {
type: "weblink", type: "weblink",
url: "/lovelace/climate", url: "/lovelace/climate",
name: "Climate controls", name: "Climate controls",
icon: "hass:arrow-right", icon: "mdi:arrow-right",
}, },
], ],
}, },
@@ -76,7 +76,7 @@ export const castDemoLovelace: () => LovelaceConfig = () => {
type: "weblink", type: "weblink",
url: "/lovelace/overview", url: "/lovelace/overview",
name: "Back", name: "Back",
icon: "hass:arrow-left", icon: "mdi:arrow-left",
}, },
], ],
}, },

View File

@@ -143,7 +143,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "on", state: "on",
attributes: { attributes: {
friendly_name: "Home Automation", friendly_name: "Home Automation",
icon: "hass:home-automation", icon: "mdi:home-automation",
}, },
}, },
"input_boolean.tvtime": { "input_boolean.tvtime": {

View File

@@ -4,7 +4,7 @@ export const demoLovelaceArsaboo: DemoConfig["lovelace"] = (localize) => ({
title: "Home Assistant", title: "Home Assistant",
views: [ views: [
{ {
icon: "hass:home-assistant", icon: "mdi:home-assistant",
id: "home", id: "home",
title: "Home", title: "Home",
cards: [ cards: [

View File

@@ -1236,7 +1236,7 @@ export const demoLovelaceJimpower: DemoConfig["lovelace"] = () => ({
}, },
], ],
path: "security", path: "security",
icon: "hass:shield-home", icon: "mdi:shield-home",
name: "Security", name: "Security",
background: background:
'center / cover no-repeat url("/assets/jimpower/background-15.jpg") fixed', 'center / cover no-repeat url("/assets/jimpower/background-15.jpg") fixed',

View File

@@ -117,7 +117,7 @@ export class DemoHaBadge extends LitElement {
} }
.card-content { .card-content {
display: flex; display: flex;
gap: 24px; gap: var(--ha-space-6);
} }
`; `;
} }

View File

@@ -155,11 +155,11 @@ export class DemoHaButton extends LitElement {
.card-content { .card-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24px; gap: var(--ha-space-6);
} }
.card-content div { .card-content div {
display: flex; display: flex;
gap: 8px; gap: var(--ha-space-2);
} }
`; `;
} }

View File

@@ -123,11 +123,11 @@ export class DemoHaProgressButton extends LitElement {
.card-content { .card-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24px; gap: var(--ha-space-6);
} }
.card-content div { .card-content div {
display: flex; display: flex;
gap: 8px; gap: var(--ha-space-2);
} }
`; `;
} }

View File

@@ -88,7 +88,7 @@ export class DemoHaSlider extends LitElement {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 24px; gap: var(--ha-space-6);
} }
`; `;
} }

View File

@@ -70,7 +70,7 @@ export class DemoHaSpinner extends LitElement {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 24px; gap: var(--ha-space-6);
} }
`; `;
} }

View File

@@ -159,7 +159,7 @@ class HassioSystemManagedDialog extends LitElement {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 16px; gap: var(--ha-space-4);
--mdc-icon-size: 48px; --mdc-icon-size: 48px;
margin-bottom: 32px; margin-bottom: 32px;
} }

View File

@@ -31,7 +31,7 @@ export const hassioStyle = css`
.card-group { .card-group {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
grid-gap: 8px; grid-gap: var(--ha-space-2);
} }
@media screen and (min-width: 640px) { @media screen and (min-width: 640px) {
.card-group { .card-group {

View File

@@ -213,7 +213,7 @@ class HaLandingPage extends LandingPageBaseElement {
ha-card .card-content { ha-card .card-content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: var(--ha-space-4);
} }
ha-alert p { ha-alert p {
text-align: unset; text-align: unset;

View File

@@ -28,13 +28,13 @@
"dependencies": { "dependencies": {
"@babel/runtime": "7.28.4", "@babel/runtime": "7.28.4",
"@braintree/sanitize-url": "7.1.1", "@braintree/sanitize-url": "7.1.1",
"@codemirror/autocomplete": "6.18.7", "@codemirror/autocomplete": "6.19.0",
"@codemirror/commands": "6.8.1", "@codemirror/commands": "6.8.1",
"@codemirror/language": "6.11.3", "@codemirror/language": "6.11.3",
"@codemirror/legacy-modes": "6.5.1", "@codemirror/legacy-modes": "6.5.1",
"@codemirror/search": "6.5.11", "@codemirror/search": "6.5.11",
"@codemirror/state": "6.5.2", "@codemirror/state": "6.5.2",
"@codemirror/view": "6.38.2", "@codemirror/view": "6.38.3",
"@date-fns/tz": "1.4.1", "@date-fns/tz": "1.4.1",
"@egjs/hammerjs": "2.0.17", "@egjs/hammerjs": "2.0.17",
"@formatjs/intl-datetimeformat": "6.18.0", "@formatjs/intl-datetimeformat": "6.18.0",
@@ -52,7 +52,7 @@
"@fullcalendar/list": "6.1.19", "@fullcalendar/list": "6.1.19",
"@fullcalendar/luxon3": "6.1.19", "@fullcalendar/luxon3": "6.1.19",
"@fullcalendar/timegrid": "6.1.19", "@fullcalendar/timegrid": "6.1.19",
"@home-assistant/webawesome": "3.0.0-beta.6.ha.0", "@home-assistant/webawesome": "3.0.0-beta.4.ha.3",
"@lezer/highlight": "1.2.1", "@lezer/highlight": "1.2.1",
"@lit-labs/motion": "1.0.9", "@lit-labs/motion": "1.0.9",
"@lit-labs/observers": "2.0.6", "@lit-labs/observers": "2.0.6",
@@ -89,8 +89,8 @@
"@thomasloven/round-slider": "0.6.0", "@thomasloven/round-slider": "0.6.0",
"@tsparticles/engine": "3.9.1", "@tsparticles/engine": "3.9.1",
"@tsparticles/preset-links": "3.2.0", "@tsparticles/preset-links": "3.2.0",
"@vaadin/combo-box": "24.9.0", "@vaadin/combo-box": "24.9.1",
"@vaadin/vaadin-themable-mixin": "24.9.0", "@vaadin/vaadin-themable-mixin": "24.9.1",
"@vibrant/color": "4.0.0", "@vibrant/color": "4.0.0",
"@vue/web-component-wrapper": "1.3.0", "@vue/web-component-wrapper": "1.3.0",
"@webcomponents/scoped-custom-element-registry": "0.0.10", "@webcomponents/scoped-custom-element-registry": "0.0.10",
@@ -111,7 +111,7 @@
"fuse.js": "7.1.0", "fuse.js": "7.1.0",
"google-timezones-json": "1.2.0", "google-timezones-json": "1.2.0",
"gulp-zopfli-green": "6.0.2", "gulp-zopfli-green": "6.0.2",
"hls.js": "1.6.12", "hls.js": "1.6.13",
"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.16", "intl-messageformat": "10.7.16",
@@ -157,8 +157,8 @@
"@octokit/auth-oauth-device": "8.0.1", "@octokit/auth-oauth-device": "8.0.1",
"@octokit/plugin-retry": "8.0.1", "@octokit/plugin-retry": "8.0.1",
"@octokit/rest": "22.0.0", "@octokit/rest": "22.0.0",
"@rsdoctor/rspack-plugin": "1.2.3", "@rsdoctor/rspack-plugin": "1.3.0",
"@rspack/core": "1.5.5", "@rspack/core": "1.5.7",
"@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",
"@types/chromecast-caf-receiver": "6.0.22", "@types/chromecast-caf-receiver": "6.0.22",
@@ -203,7 +203,7 @@
"husky": "9.1.7", "husky": "9.1.7",
"jsdom": "27.0.0", "jsdom": "27.0.0",
"jszip": "3.10.1", "jszip": "3.10.1",
"lint-staged": "16.1.6", "lint-staged": "16.2.1",
"lit-analyzer": "2.0.3", "lit-analyzer": "2.0.3",
"lodash.merge": "4.6.2", "lodash.merge": "4.6.2",
"lodash.template": "4.5.0", "lodash.template": "4.5.0",
@@ -213,11 +213,11 @@
"rspack-manifest-plugin": "5.1.0", "rspack-manifest-plugin": "5.1.0",
"serve": "14.2.5", "serve": "14.2.5",
"sinon": "21.0.0", "sinon": "21.0.0",
"tar": "7.4.3", "tar": "7.5.1",
"terser-webpack-plugin": "5.3.14", "terser-webpack-plugin": "5.3.14",
"ts-lit-plugin": "2.0.2", "ts-lit-plugin": "2.0.2",
"typescript": "5.9.2", "typescript": "5.9.2",
"typescript-eslint": "8.44.0", "typescript-eslint": "8.44.1",
"vite-tsconfig-paths": "5.1.4", "vite-tsconfig-paths": "5.1.4",
"vitest": "3.2.4", "vitest": "3.2.4",
"webpack-stats-plugin": "1.1.3", "webpack-stats-plugin": "1.1.3",
@@ -235,5 +235,5 @@
"tslib": "2.8.1", "tslib": "2.8.1",
"@material/mwc-list@^0.27.0": "patch:@material/mwc-list@npm%3A0.27.0#~/.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch" "@material/mwc-list@^0.27.0": "patch:@material/mwc-list@npm%3A0.27.0#~/.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch"
}, },
"packageManager": "yarn@4.10.2" "packageManager": "yarn@4.10.3"
} }

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "home-assistant-frontend" name = "home-assistant-frontend"
version = "20251001.0" version = "20250924.0"
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

@@ -1,23 +1,40 @@
import { formatHex, parse } from "culori";
/**
* Expands a 3-digit hex color to a 6-digit hex color.
* @param hex - The hex color to expand.
* @returns The expanded hex color.
* @throws If the hex color is invalid.
*/
export const expandHex = (hex: string): string => { export const expandHex = (hex: string): string => {
hex = hex.replace("#", ""); const color = parse(hex);
if (hex.length === 6) return hex; if (!color) {
let result = ""; throw new Error(`Invalid hex color: ${hex}`);
for (const val of hex) {
result += val + val;
} }
return result; const formattedColor = formatHex(color);
if (!formattedColor) {
throw new Error(`Could not format hex color: ${hex}`);
}
return formattedColor.replace("#", "");
}; };
// Blend 2 hex colors: c1 is placed over c2, blend is c1's opacity. /**
* Blends two hex colors. c1 is placed over c2, blend is c1's opacity.
* @param c1 - The first hex color.
* @param c2 - The second hex color.
* @param blend - The blend percentage (0-100).
* @returns The blended hex color.
*/
export const hexBlend = (c1: string, c2: string, blend = 50): string => { export const hexBlend = (c1: string, c2: string, blend = 50): string => {
let color = "";
c1 = expandHex(c1); c1 = expandHex(c1);
c2 = expandHex(c2); c2 = expandHex(c2);
let color = "";
for (let i = 0; i <= 5; i += 2) { for (let i = 0; i <= 5; i += 2) {
const h1 = parseInt(c1.substring(i, i + 2), 16); const h1 = parseInt(c1.substring(i, i + 2), 16);
const h2 = parseInt(c2.substring(i, i + 2), 16); const h2 = parseInt(c2.substring(i, i + 2), 16);
let hex = Math.floor(h2 + (h1 - h2) * (blend / 100)).toString(16); const hex = Math.floor(h2 + (h1 - h2) * (blend / 100))
while (hex.length < 2) hex = "0" + hex; .toString(16)
.padStart(2, "0");
color += hex; color += hex;
} }
return `#${color}`; return `#${color}`;

View File

@@ -1,28 +1,49 @@
export const luminosity = (rgb: [number, number, number]): number => { import { wcagLuminance, wcagContrast } from "culori";
// http://www.w3.org/TR/WCAG20/#relativeluminancedef
const lum: [number, number, number] = [0, 0, 0];
for (let i = 0; i < rgb.length; i++) {
const chan = rgb[i] / 255;
lum[i] = chan <= 0.03928 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
}
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2]; /**
}; * Calculates the luminosity of an RGB color.
* @param rgb - The RGB color to calculate the luminosity of.
* @returns The luminosity of the color.
*/
export const luminosity = (rgb: [number, number, number]): number =>
wcagLuminance({
mode: "rgb",
r: rgb[0] / 255,
g: rgb[1] / 255,
b: rgb[2] / 255,
});
/**
* Calculates the contrast ratio between two RGB colors.
* @param color1 - The first color to calculate the contrast ratio of.
* @param color2 - The second color to calculate the contrast ratio of.
* @returns The contrast ratio between the two colors.
*/
export const rgbContrast = ( export const rgbContrast = (
color1: [number, number, number], color1: [number, number, number],
color2: [number, number, number] color2: [number, number, number]
) => { ) =>
const lum1 = luminosity(color1); wcagContrast(
const lum2 = luminosity(color2); {
mode: "rgb",
if (lum1 > lum2) { r: color1[0] / 255,
return (lum1 + 0.05) / (lum2 + 0.05); g: color1[1] / 255,
b: color1[2] / 255,
},
{
mode: "rgb",
r: color2[0] / 255,
g: color2[1] / 255,
b: color2[2] / 255,
} }
);
return (lum2 + 0.05) / (lum1 + 0.05); /**
}; * Calculates the contrast ratio between two RGB colors.
* @param rgb1 - The first color to calculate the contrast ratio of.
* @param rgb2 - The second color to calculate the contrast ratio of.
* @returns The contrast ratio between the two colors.
*/
export const getRGBContrastRatio = ( export const getRGBContrastRatio = (
rgb1: [number, number, number], rgb1: [number, number, number],
rgb2: [number, number, number] rgb2: [number, number, number]

View File

@@ -974,7 +974,7 @@ export class HaChartBase extends LitElement {
right: 4px; right: 4px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 4px; gap: var(--ha-space-1);
} }
.chart-controls.small { .chart-controls.small {
top: 0; top: 0;
@@ -1011,7 +1011,7 @@ export class HaChartBase extends LitElement {
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
} }
.chart-legend li { .chart-legend li {
height: 24px; height: 24px;

View File

@@ -54,7 +54,7 @@ export class HaBadge extends LitElement {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 8px; gap: var(--ha-space-2);
height: var(--ha-badge-size, 36px); height: var(--ha-badge-size, 36px);
min-width: var(--ha-badge-size, 36px); min-width: var(--ha-badge-size, 36px);
padding: 0px 12px; padding: 0px 12px;

View File

@@ -76,7 +76,7 @@ export class HaCopyTextfield extends LitElement {
.container { .container {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
margin-top: 8px; margin-top: 8px;
} }

View File

@@ -343,7 +343,7 @@ export class HaDateRangePicker extends LitElement {
.date-range-inputs { .date-range-inputs {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
} }
.date-range-ranges { .date-range-ranges {

View File

@@ -77,8 +77,8 @@ export class HaFormGrid extends LitElement implements HaFormElement {
var(--form-grid-column-count, auto-fit), var(--form-grid-column-count, auto-fit),
minmax(var(--form-grid-min-width, 200px), 1fr) minmax(var(--form-grid-min-width, 200px), 1fr)
); );
grid-column-gap: 8px; grid-column-gap: var(--ha-space-2);
grid-row-gap: 24px; grid-row-gap: var(--ha-space-6);
} }
:host > ha-form { :host > ha-form {
display: block; display: block;

View File

@@ -156,7 +156,7 @@ export class HaFormOptionalActions extends LitElement implements HaFormElement {
:host { :host {
display: flex !important; display: flex !important;
flex-direction: column; flex-direction: column;
gap: 24px; gap: var(--ha-space-6);
} }
:host ha-form { :host ha-form {
display: block; display: block;

View File

@@ -57,7 +57,7 @@ export class HaFormfield extends FormfieldBase {
} }
.mdc-form-field { .mdc-form-field {
align-items: var(--ha-formfield-align-items, center); align-items: var(--ha-formfield-align-items, center);
gap: 4px; gap: var(--ha-space-1);
} }
.mdc-form-field > label { .mdc-form-field > label {
direction: var(--direction); direction: var(--direction);

View File

@@ -227,7 +227,7 @@ export class HaGridSizeEditor extends LitElement {
"row-slider preview"; "row-slider preview";
grid-template-rows: auto auto; grid-template-rows: auto auto;
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
gap: 8px; gap: var(--ha-space-2);
} }
#columns { #columns {
grid-area: column-slider; grid-area: column-slider;

View File

@@ -104,7 +104,7 @@ export class HaIconButtonToolbar extends LitElement {
background-color: transparent; background-color: transparent;
padding-right: 4px; padding-right: 4px;
height: var(--icon-button-toolbar-height); height: var(--icon-button-toolbar-height);
gap: 8px; gap: var(--ha-space-2);
} }
.icon-toolbar-button { .icon-toolbar-button {

View File

@@ -105,7 +105,7 @@ export class HaPickerField extends LitElement {
--md-list-item-bottom-space: 0px; --md-list-item-bottom-space: 0px;
--md-list-item-leading-space: 8px; --md-list-item-leading-space: 8px;
--md-list-item-trailing-space: 8px; --md-list-item-trailing-space: 8px;
--ha-md-list-item-gap: 8px; --ha-md-list-item-gap: var(--ha-space-2);
/* Remove the default focus ring */ /* Remove the default focus ring */
--md-focus-ring-width: 0px; --md-focus-ring-width: 0px;
--md-focus-ring-duration: 0s; --md-focus-ring-duration: 0s;

View File

@@ -90,7 +90,7 @@ class HaSegmentedBar extends LitElement {
.heading { .heading {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
} }
.heading .title { .heading .title {
flex: 1; flex: 1;
@@ -125,7 +125,7 @@ class HaSegmentedBar extends LitElement {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
gap: 12px; gap: var(--ha-space-3);
margin: 12px 0; margin: 12px 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
@@ -133,7 +133,7 @@ class HaSegmentedBar extends LitElement {
.legend li { .legend li {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: var(--ha-space-1);
font-size: var(--ha-font-size-s); font-size: var(--ha-font-size-s);
} }
.legend li .bullet { .legend li .bullet {

View File

@@ -116,7 +116,7 @@ export class HaSelectBox extends LitElement {
.list { .list {
display: grid; display: grid;
grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr)); grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
gap: 12px; gap: var(--ha-space-3);
} }
.option { .option {
position: relative; position: relative;
@@ -128,7 +128,7 @@ export class HaSelectBox extends LitElement {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 12px; padding: 12px;
gap: 8px; gap: var(--ha-space-2);
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;
} }
@@ -137,7 +137,7 @@ export class HaSelectBox extends LitElement {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
min-width: 0; min-width: 0;
width: 100%; width: 100%;
} }
@@ -148,7 +148,7 @@ export class HaSelectBox extends LitElement {
.option .content .text { .option .content .text {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 4px; gap: var(--ha-space-1);
min-width: 0; min-width: 0;
flex: 1; flex: 1;
} }

View File

@@ -89,7 +89,7 @@ export class HaButtonToggleSelector extends LitElement {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: var(--ha-space-2);
align-items: center; align-items: center;
} }
@media all and (max-width: 600px) { @media all and (max-width: 600px) {

View File

@@ -62,7 +62,7 @@ export class HaColorTempSelector extends LitElement {
"--ha-slider-background": `linear-gradient( to var(--float-end), ${gradient})`, "--ha-slider-background": `linear-gradient( to var(--float-end), ${gradient})`,
})} })}
labeled labeled
icon="hass:thermometer" icon="mdi:thermometer"
.caption=${this.label || ""} .caption=${this.label || ""}
.min=${min} .min=${min}
.max=${max} .max=${max}

View File

@@ -321,7 +321,7 @@ export class HaMediaSelector extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 8px; padding: 8px;
gap: 12px; gap: var(--ha-space-3);
} }
ha-card .thumbnail { ha-card .thumbnail {
width: 40px; width: 40px;

View File

@@ -297,7 +297,7 @@ export class HaObjectSelector extends LitElement {
return [ return [
css` css`
ha-md-list { ha-md-list {
gap: 8px; gap: var(--ha-space-2);
} }
ha-md-list-item { ha-md-list-item {
border: 1px solid var(--divider-color); border: 1px solid var(--divider-color);

View File

@@ -217,7 +217,7 @@ class DialogJoinMediaPlayers extends LitElement {
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
row-gap: 16px; row-gap: var(--ha-space-4);
} }
ha-dialog-header ha-button { ha-dialog-header ha-button {

View File

@@ -1138,7 +1138,7 @@ export class HaMediaPlayerBrowse extends LitElement {
auto-fit, auto-fit,
minmax(var(--media-browse-item-size, 175px), 0.1fr) minmax(var(--media-browse-item-size, 175px), 0.1fr)
); );
grid-gap: 16px; grid-gap: var(--ha-space-4);
padding: 16px; padding: 16px;
} }

View File

@@ -54,7 +54,7 @@ class HaMediaPlayerToggle extends LitElement {
.list-item { .list-item {
display: grid; display: grid;
grid-template-columns: auto 1fr auto; grid-template-columns: auto 1fr auto;
column-gap: 16px; column-gap: var(--ha-space-4);
align-items: center; align-items: center;
width: 100%; width: 100%;
} }

View File

@@ -39,6 +39,8 @@ import type { HomeAssistant, TranslationDict } from "../types";
import { isUnavailableState } from "./entity"; import { isUnavailableState } from "./entity";
import { isTTSMediaSource } from "./tts"; import { isTTSMediaSource } from "./tts";
import { generateEntityFilter } from "../common/entity/entity_filter";
interface MediaPlayerEntityAttributes extends HassEntityAttributeBase { interface MediaPlayerEntityAttributes extends HassEntityAttributeBase {
media_content_id?: string; media_content_id?: string;
media_content_type?: string; media_content_type?: string;
@@ -522,3 +524,33 @@ export const mediaPlayerJoin = (
export const mediaPlayerUnjoin = (hass: HomeAssistant, entity_id: string) => export const mediaPlayerUnjoin = (hass: HomeAssistant, entity_id: string) =>
hass.callService("media_player", "unjoin", {}, { entity_id }); hass.callService("media_player", "unjoin", {}, { entity_id });
/**
* Compute active media player states in a specific area.
* @param hass Home Assistant object
* @param areaId Area ID to filter media players by
* @returns Array of playing media player entities
*/
export const computeActiveAreaMediaStates = (
hass: HomeAssistant,
areaId: string
): MediaPlayerEntity[] => {
const area = hass.areas[areaId];
if (!area) {
return [];
}
// Get all media_player entities in this area
const mediaFilter = generateEntityFilter(hass, {
area: areaId,
domain: "media_player",
});
const mediaEntities = Object.keys(hass.entities).filter(mediaFilter);
return mediaEntities
.map((entityId) => hass.states[entityId] as MediaPlayerEntity | undefined)
.filter(
(stateObj): stateObj is MediaPlayerEntity => stateObj?.state === "playing"
);
};

View File

@@ -66,9 +66,9 @@ export const getPanelIcon = (panel: PanelInfo): string | null => {
if (!panel.icon) { if (!panel.icon) {
switch (panel.component_name) { switch (panel.component_name) {
case "profile": case "profile":
return "hass:account"; return "mdi:account";
case "lovelace": case "lovelace":
return "hass:view-dashboard"; return "mdi:view-dashboard";
} }
} }

View File

@@ -325,7 +325,7 @@ class StepFlowCreateEntry extends LitElement {
.device-info { .device-info {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
} }
.device-info img { .device-info img {
width: 40px; width: 40px;

View File

@@ -209,7 +209,7 @@ export class DialogEnterCode
display: grid; display: grid;
grid-template-columns: repeat(var(--keypad-columns), auto); grid-template-columns: repeat(var(--keypad-columns), auto);
grid-auto-rows: auto; grid-auto-rows: auto;
grid-gap: 24px; grid-gap: var(--ha-space-6);
justify-items: center; justify-items: center;
align-items: center; align-items: center;
} }

View File

@@ -32,7 +32,7 @@ export class HaMoreInfoControlSelectContainer extends LitElement {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
gap: 12px; gap: var(--ha-space-3);
margin: auto; margin: auto;
overflow: auto; overflow: auto;
-ms-overflow-style: none; /* IE and Edge */ -ms-overflow-style: none; /* IE and Edge */

View File

@@ -110,7 +110,7 @@ class LightRgbColorPicker extends LitElement {
? html`<ha-labeled-slider ? html`<ha-labeled-slider
labeled labeled
.caption=${this.hass.localize("ui.card.light.color_brightness")} .caption=${this.hass.localize("ui.card.light.color_brightness")}
icon="hass:brightness-7" icon="mdi:brightness-7"
min="0" min="0"
max="100" max="100"
.value=${this._colorBrightnessSliderValue} .value=${this._colorBrightnessSliderValue}
@@ -122,7 +122,7 @@ class LightRgbColorPicker extends LitElement {
<ha-labeled-slider <ha-labeled-slider
labeled labeled
.caption=${this.hass.localize("ui.card.light.white_value")} .caption=${this.hass.localize("ui.card.light.white_value")}
icon="hass:file-word-box" icon="mdi:file-word-box"
min="0" min="0"
max="100" max="100"
.name=${"wv"} .name=${"wv"}
@@ -136,7 +136,7 @@ class LightRgbColorPicker extends LitElement {
<ha-labeled-slider <ha-labeled-slider
labeled labeled
.caption=${this.hass.localize("ui.card.light.cold_white_value")} .caption=${this.hass.localize("ui.card.light.cold_white_value")}
icon="hass:file-word-box-outline" icon="mdi:file-word-box-outline"
min="0" min="0"
max="100" max="100"
.name=${"cw"} .name=${"cw"}
@@ -146,7 +146,7 @@ class LightRgbColorPicker extends LitElement {
<ha-labeled-slider <ha-labeled-slider
labeled labeled
.caption=${this.hass.localize("ui.card.light.warm_white_value")} .caption=${this.hass.localize("ui.card.light.warm_white_value")}
icon="hass:file-word-box" icon="mdi:file-word-box"
min="0" min="0"
max="100" max="100"
.name=${"ww"} .name=${"ww"}

View File

@@ -202,13 +202,13 @@ class MoreInfoSirenAdvancedControls extends LitElement {
.options { .options {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: var(--ha-space-4);
} }
.controls { .controls {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
gap: 16px; gap: var(--ha-space-4);
margin-top: 16px; margin-top: 16px;
} }
ha-control-button { ha-control-button {

View File

@@ -107,7 +107,7 @@ class MoreInfoCamera extends LitElement {
box-sizing: border-box; box-sizing: border-box;
padding: 16px; padding: 16px;
z-index: 1; z-index: 1;
gap: 8px; gap: var(--ha-space-2);
} }
`; `;
} }

View File

@@ -181,7 +181,7 @@ class MoreInfoLock extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
font-weight: var(--ha-font-weight-medium); font-weight: var(--ha-font-weight-medium);
color: var(--success-color); color: var(--success-color);
} }

View File

@@ -258,10 +258,7 @@ class MoreInfoMediaPlayer extends LitElement {
const stateObj = this.stateObj; const stateObj = this.stateObj;
const controls = computeMediaControls(stateObj, true); const controls = computeMediaControls(stateObj, true);
const coverUrl = const coverUrl = stateObj.attributes.entity_picture || "";
stateObj.attributes.entity_picture_local ||
stateObj.attributes.entity_picture ||
"";
const playerObj = new HassMediaPlayerEntity(this.hass, this.stateObj); const playerObj = new HassMediaPlayerEntity(this.hass, this.stateObj);
const position = Math.max(Math.floor(playerObj.currentProgress || 0), 0); const position = Math.max(Math.floor(playerObj.currentProgress || 0), 0);
@@ -445,7 +442,7 @@ class MoreInfoMediaPlayer extends LitElement {
:host { :host {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24px; gap: var(--ha-space-6);
margin-top: 0; margin-top: 0;
} }
@@ -529,7 +526,7 @@ class MoreInfoMediaPlayer extends LitElement {
.volume { .volume {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: var(--ha-space-3);
margin-left: 8px; margin-left: 8px;
} }
@@ -610,7 +607,7 @@ class MoreInfoMediaPlayer extends LitElement {
.bottom-controls { .bottom-controls {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24px; gap: var(--ha-space-6);
align-self: center; align-self: center;
width: 320px; width: 320px;
} }

View File

@@ -508,7 +508,7 @@ class MoreInfoUpdate extends LitElement {
box-sizing: border-box; box-sizing: border-box;
padding: 16px; padding: 16px;
z-index: 1; z-index: 1;
gap: 8px; gap: var(--ha-space-2);
} }
a { a {

View File

@@ -269,7 +269,7 @@ class DialogShortcuts extends LitElement {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
margin: 4px 0; margin: 4px 0;
} }

View File

@@ -127,7 +127,7 @@ export class CloudStepIntro extends LitElement {
.features { .features {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
grid-gap: 16px; grid-gap: var(--ha-space-4);
padding: 16px; padding: 16px;
} }
.feature { .feature {

View File

@@ -427,7 +427,7 @@ export class HaVoiceAssistantSetupStepPipeline extends LitElement {
width: 100%; width: 100%;
height: 10px; height: 10px;
display: flex; display: flex;
gap: 4px; gap: var(--ha-space-1);
margin: 8px 0; margin: 8px 0;
} }
.segment { .segment {

View File

@@ -368,7 +368,7 @@ export class HaVoiceAssistantSetupStepSuccess extends LitElement {
margin-top: 24px; margin-top: 24px;
} }
.rows { .rows {
gap: 16px; gap: var(--ha-space-4);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }

View File

@@ -60,28 +60,28 @@ export const demoPanels: Panels = {
// Uncomment when we are ready to stub the history API // Uncomment when we are ready to stub the history API
// history: { // history: {
// component_name: "history", // component_name: "history",
// icon: "hass:poll-box", // icon: "mdi:chart-box",
// title: "history", // title: "history",
// config: null, // config: null,
// url_path: "history", // url_path: "history",
// }, // },
map: { map: {
component_name: "lovelace", component_name: "lovelace",
icon: "hass:tooltip-account", icon: "mdi:tooltip-account",
title: "map", title: "map",
config: { mode: "storage" }, config: { mode: "storage" },
url_path: "map", url_path: "map",
}, },
energy: { energy: {
component_name: "energy", component_name: "energy",
icon: "hass:lightning-bolt", icon: "mdi:lightning-bolt",
title: "energy", title: "energy",
config: null, config: null,
url_path: "energy", url_path: "energy",
}, },
// config: { // config: {
// component_name: "config", // component_name: "config",
// icon: "hass:cog", // icon: "mdi:cog",
// title: "config", // title: "config",
// config: null, // config: null,
// url_path: "config", // url_path: "config",

View File

@@ -182,7 +182,7 @@ class HassSubpage extends LitElement {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-end; justify-content: flex-end;
gap: 8px; gap: var(--ha-space-2);
} }
:host([narrow]) #fab.tabs { :host([narrow]) #fab.tabs {
bottom: calc(84px + var(--safe-area-inset-bottom, 0px)); bottom: calc(84px + var(--safe-area-inset-bottom, 0px));

View File

@@ -740,7 +740,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
padding: 0 16px; padding: 0 16px;
gap: 16px; gap: var(--ha-space-4);
box-sizing: border-box; box-sizing: border-box;
background: var(--primary-background-color); background: var(--primary-background-color);
border-bottom: 1px solid var(--divider-color); border-bottom: 1px solid var(--divider-color);
@@ -823,7 +823,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
display: flex; display: flex;
align-items: center; align-items: center;
min-width: 100%; min-width: 100%;
gap: 16px; gap: var(--ha-space-4);
padding: 0 16px; padding: 0 16px;
box-sizing: border-box; box-sizing: border-box;
overflow-x: scroll; overflow-x: scroll;
@@ -852,7 +852,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
.selection-controls { .selection-controls {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
} }
.selection-controls p { .selection-controls p {
@@ -864,7 +864,7 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
.center-vertical { .center-vertical {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
} }
.relative { .relative {

View File

@@ -362,7 +362,7 @@ class HassTabsSubpage extends LitElement {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: flex-end; justify-content: flex-end;
gap: 8px; gap: var(--ha-space-2);
} }
:host([narrow]) #fab.tabs { :host([narrow]) #fab.tabs {
bottom: calc(84px + var(--safe-area-inset-bottom, 0px)); bottom: calc(84px + var(--safe-area-inset-bottom, 0px));

View File

@@ -212,7 +212,7 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {
margin-top: 24px; margin-top: 24px;
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
row-gap: 24px; row-gap: var(--ha-space-6);
} }
.more { .more {
display: flex; display: flex;

View File

@@ -64,8 +64,8 @@ class OnboardingWelcomeLinks extends LitElement {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
margin-top: 16px; margin-top: 16px;
column-gap: 16px; column-gap: var(--ha-space-4);
row-gap: 16px; row-gap: var(--ha-space-4);
} }
@media (max-width: 550px) { @media (max-width: 550px) {
:host { :host {

View File

@@ -123,7 +123,7 @@ class OnboardingRestoreBackupCloudLogin extends LitElement {
font-size: var(--ha-font-size-2xl); font-size: var(--ha-font-size-2xl);
display: flex; display: flex;
align-items: center; align-items: center;
gap: 16px; gap: var(--ha-space-4);
} }
h2 img { h2 img {
width: 48px; width: 48px;

View File

@@ -332,7 +332,7 @@ class OnboardingRestoreBackupRestore extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
line-height: var(--ha-line-height-condensed); line-height: var(--ha-line-height-condensed);
} }
h2 { h2 {

View File

@@ -736,7 +736,7 @@ class DialogAddAutomationElement
} }
.shortcut-label { .shortcut-label {
display: flex; display: flex;
gap: 12px; gap: var(--ha-space-3);
justify-content: space-between; justify-content: space-between;
} }
.shortcut-label .supporting-text { .shortcut-label .supporting-text {

View File

@@ -92,7 +92,7 @@ class DialogPasteReplace extends LitElement implements HassDialog {
} }
div[slot="primaryAction"] { div[slot="primaryAction"] {
display: flex; display: flex;
gap: 8px; gap: var(--ha-space-2);
} }
`, `,
]; ];

View File

@@ -118,7 +118,7 @@ export const manualEditorStyles = css`
var(--ha-automation-editor-max-width) - var(--ha-automation-editor-max-width) -
${CONTENT_MIN_WIDTH}px - var(--mdc-drawer-width, 0px) ${CONTENT_MIN_WIDTH}px - var(--mdc-drawer-width, 0px)
); );
--sidebar-gap: 16px; --sidebar-gap: var(--ha-space-4);
} }
.fab-positioner { .fab-positioner {
@@ -188,7 +188,7 @@ export const automationRowsStyles = css`
.rows { .rows {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: var(--ha-space-4);
} }
.rows.no-sidebar { .rows.no-sidebar {
margin-inline-end: 0; margin-inline-end: 0;
@@ -225,7 +225,7 @@ export const automationRowsStyles = css`
.buttons { .buttons {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: var(--ha-space-2);
order: 1; order: 1;
} }
`; `;
@@ -244,7 +244,7 @@ export const overflowStyles = css`
.overflow-label { .overflow-label {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
gap: 12px; gap: var(--ha-space-3);
white-space: nowrap; white-space: nowrap;
} }
.overflow-label .shortcut { .overflow-label .shortcut {

View File

@@ -806,7 +806,7 @@ export default class HaAutomationTriggerRow extends LitElement {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 4px; gap: var(--ha-space-1);
line-height: 1; line-height: 1;
padding: 0; padding: 0;
} }

View File

@@ -313,13 +313,13 @@ class HaBackupConfigAgents extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
line-height: var(--ha-line-height-condensed); line-height: var(--ha-line-height-condensed);
} }
.unencrypted-warning { .unencrypted-warning {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: var(--ha-space-1);
} }
.dot { .dot {
display: block; display: block;
@@ -341,7 +341,7 @@ class HaBackupConfigAgents extends LitElement {
align-items: flex-start; align-items: flex-start;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
gap: 4px; gap: var(--ha-space-1);
} }
} }
`; `;

View File

@@ -119,7 +119,7 @@ class HaBackupAgentsPicker extends LitElement {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 16px; gap: var(--ha-space-4);
font-size: var(--ha-font-size-l); font-size: var(--ha-font-size-l);
font-weight: var(--ha-font-weight-normal); font-weight: var(--ha-font-weight-normal);
line-height: var(--ha-line-height-normal); line-height: var(--ha-line-height-normal);

View File

@@ -110,7 +110,7 @@ class HaBackupDetailsRestore extends LitElement {
max-width: 690px; max-width: 690px;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: grid; display: grid;
} }
.card-content { .card-content {
@@ -133,7 +133,7 @@ class HaBackupDetailsRestore extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
line-height: var(--ha-line-height-condensed); line-height: var(--ha-line-height-condensed);
} }
`; `;

View File

@@ -138,7 +138,7 @@ class HaBackupDetailsSummary extends LitElement {
max-width: 690px; max-width: 690px;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: grid; display: grid;
} }
.card-content { .card-content {
@@ -168,7 +168,7 @@ class HaBackupDetailsSummary extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
line-height: var(--ha-line-height-condensed); line-height: var(--ha-line-height-condensed);
} }
`; `;

View File

@@ -35,7 +35,7 @@ class SupervisorFormfieldLabel extends LitElement {
:host { :host {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 16px; gap: var(--ha-space-4);
align-items: center; align-items: center;
} }
.label { .label {

View File

@@ -74,8 +74,8 @@ class HaBackupSummaryCard extends LitElement {
.summary { .summary {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
column-gap: 16px; column-gap: var(--ha-space-4);
row-gap: 8px; row-gap: var(--ha-space-2);
align-items: center; align-items: center;
padding: 16px; padding: 16px;
padding-bottom: 8px; padding-bottom: 8px;

View File

@@ -117,7 +117,7 @@ class HaBackupOverviewBackups extends LitElement {
padding: 28px 20px 0; padding: 28px 20px 0;
max-width: 690px; max-width: 690px;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: calc(72px + var(--safe-area-inset-bottom)); margin-bottom: calc(72px + var(--safe-area-inset-bottom));

View File

@@ -61,7 +61,7 @@ class HaBackupOverviewBackups extends LitElement {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 16px; gap: var(--ha-space-4);
} }
.icon { .icon {
position: relative; position: relative;

View File

@@ -303,7 +303,7 @@ class HaBackupBackupsSummary extends LitElement {
padding: 28px 20px 0; padding: 28px 20px 0;
max-width: 690px; max-width: 690px;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 24px; margin-bottom: 24px;

View File

@@ -334,7 +334,7 @@ class HaBackupOverviewBackups extends LitElement {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 16px; gap: var(--ha-space-4);
} }
p { p {
margin: 0; margin: 0;

View File

@@ -579,7 +579,7 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 24px; gap: var(--ha-space-6);
} }
.encryption-key p { .encryption-key p {
margin: 0; margin: 0;

View File

@@ -305,7 +305,7 @@ class DialogChangeBackupEncryptionKey extends LitElement implements HassDialog {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 24px; gap: var(--ha-space-6);
} }
.encryption-key p { .encryption-key p {
margin: 0; margin: 0;

View File

@@ -231,7 +231,7 @@ class DialogSetBackupEncryptionKey extends LitElement implements HassDialog {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 24px; gap: var(--ha-space-6);
} }
.encryption-key p { .encryption-key p {
margin: 0; margin: 0;

View File

@@ -153,7 +153,7 @@ class DialogShowBackupEncryptionKey extends LitElement implements HassDialog {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 24px; gap: var(--ha-space-6);
} }
.encryption-key p { .encryption-key p {
margin: 0; margin: 0;

View File

@@ -189,7 +189,7 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
0 0
); );
return html` return html`
<div style="display: flex; gap: 4px;"> <div style="display: flex; gap: var(--ha-space-1);">
${displayedAgentIds.map((agentId) => { ${displayedAgentIds.map((agentId) => {
const name = computeBackupAgentName( const name = computeBackupAgentName(
this.hass.localize, this.hass.localize,

View File

@@ -356,7 +356,7 @@ class HaConfigBackupDetails extends LitElement {
padding: 28px 20px 0; padding: 28px 20px 0;
max-width: 690px; max-width: 690px;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: grid; display: grid;
margin-bottom: 24px; margin-bottom: 24px;
} }
@@ -399,7 +399,7 @@ class HaConfigBackupDetails extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
line-height: var(--ha-line-height-condensed); line-height: var(--ha-line-height-condensed);
} }
.dot { .dot {

View File

@@ -326,7 +326,7 @@ class HaConfigBackupDetails extends LitElement {
padding: 28px 20px 0; padding: 28px 20px 0;
max-width: 690px; max-width: 690px;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: grid; display: grid;
margin-bottom: 24px; margin-bottom: 24px;
} }
@@ -376,7 +376,7 @@ class HaConfigBackupDetails extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
gap: 8px; gap: var(--ha-space-2);
line-height: var(--ha-line-height-condensed); line-height: var(--ha-line-height-condensed);
} }
.dot { .dot {

View File

@@ -248,7 +248,7 @@ class HaConfigBackupOverview extends LitElement {
padding: 28px 20px 0; padding: 28px 20px 0;
max-width: 690px; max-width: 690px;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: calc(var(--safe-area-inset-bottom) + 72px); margin-bottom: calc(var(--safe-area-inset-bottom) + 72px);

View File

@@ -510,7 +510,7 @@ class HaConfigBackupSettings extends LitElement {
padding: 28px 20px 0; padding: 28px 20px 0;
max-width: 690px; max-width: 690px;
margin: 0 auto; margin: 0 auto;
gap: 24px; gap: var(--ha-space-6);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 24px; margin-bottom: 24px;
@@ -532,7 +532,7 @@ class HaConfigBackupSettings extends LitElement {
} }
.cloud-info .cloud-header { .cloud-info .cloud-header {
display: flex; display: flex;
gap: 16px; gap: var(--ha-space-4);
font-size: var(--ha-font-size-xl); font-size: var(--ha-font-size-xl);
align-items: center; align-items: center;
padding: 16px; padding: 16px;

View File

@@ -129,7 +129,7 @@ export class DialogSupportPackage extends LitElement {
} }
.actions { .actions {
display: flex; display: flex;
gap: 8px; gap: var(--ha-space-2);
justify-content: flex-end; justify-content: flex-end;
} }
hr { hr {

View File

@@ -59,7 +59,7 @@ export class DashboardCard extends LitElement {
padding: 12px; padding: 12px;
display: block; display: block;
text-align: var(--float-start); text-align: var(--float-start);
gap: 8px; gap: var(--ha-space-2);
} }
.preview { .preview {
padding: 16px; padding: 16px;

View File

@@ -921,7 +921,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
.header { .header {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 24px; gap: var(--ha-space-6);
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 24px; margin-bottom: 24px;
@@ -932,7 +932,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
} }
.title { .title {
display: flex; display: flex;
gap: 4px; gap: var(--ha-space-1);
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
} }
@@ -991,7 +991,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
.actions { .actions {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: var(--ha-space-2);
} }
.section { .section {
width: 100%; width: 100%;
@@ -1013,7 +1013,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
.integration-info { .integration-info {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
} }
.integration-info ha-svg-icon { .integration-info ha-svg-icon {
min-width: 24px; min-width: 24px;

View File

@@ -1013,7 +1013,7 @@ class HaConfigIntegrationsDashboard extends KeyboardShortcutMixin(
z-index: 2; z-index: 2;
background-color: var(--primary-background-color); background-color: var(--primary-background-color);
padding: 0 16px; padding: 0 16px;
gap: 16px; gap: var(--ha-space-4);
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid var(--divider-color); border-bottom: 1px solid var(--divider-color);
} }

View File

@@ -91,7 +91,7 @@ class MatterAddDeviceNew extends LitElement {
justify-content: space-between; justify-content: space-between;
padding: 0 24px; padding: 0 24px;
box-sizing: border-box; box-sizing: border-box;
gap: 16px; gap: var(--ha-space-4);
width: 100%; width: 100%;
max-width: 400px; max-width: 400px;
} }

View File

@@ -143,7 +143,9 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
slot="fab" slot="fab"
@click=${this._importExternalThreadCredentials} @click=${this._importExternalThreadCredentials}
extended extended
label="Send credentials to Home Assistant" .label=${this.hass.localize(
"ui.panel.config.thread.thread_network_send_credentials_ha"
)}
><ha-svg-icon slot="icon" .path=${mdiCellphoneKey}></ha-svg-icon ><ha-svg-icon slot="icon" .path=${mdiCellphoneKey}></ha-svg-icon
></ha-fab>` ></ha-fab>`
: nothing} : nothing}
@@ -310,7 +312,9 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
<ha-button <ha-button
.datasetId=${network.dataset.dataset_id} .datasetId=${network.dataset.dataset_id}
@click=${this._setPreferred} @click=${this._setPreferred}
>Make preferred network</ha-button >${this.hass.localize(
"ui.panel.config.thread.thread_network_make_preferred"
)}</ha-button
> >
</div>` </div>`
: ""} : ""}
@@ -322,7 +326,9 @@ export class ThreadConfigPanel extends SubscribeMixin(LitElement) {
size="small" size="small"
.networkDataset=${network.dataset} .networkDataset=${network.dataset}
@click=${this._sendCredentials} @click=${this._sendCredentials}
>Send credentials to phone</ha-button >${this.hass.localize(
"ui.panel.config.thread.thread_network_send_credentials_phone"
)}</ha-button
> >
</div>` </div>`
: ""} : ""}

View File

@@ -209,7 +209,7 @@ class ZWaveJSCapabilityThermostatSetback extends LitElement {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
gap: 16px; gap: var(--ha-space-4);
} }
:host > ha-select { :host > ha-select {
width: 100%; width: 100%;
@@ -225,7 +225,7 @@ class ZWaveJSCapabilityThermostatSetback extends LitElement {
.setback-state { .setback-state {
width: 100%; width: 100%;
display: flex; display: flex;
gap: 16px; gap: var(--ha-space-4);
} }
.setback-state ha-select, .setback-state ha-select,
ha-textfield { ha-textfield {

View File

@@ -362,7 +362,7 @@ class DialogZWaveJSRemoveNode extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
gap: 16px; gap: var(--ha-space-4);
text-align: center; text-align: center;
} }

View File

@@ -997,7 +997,7 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
.right-buttons { .right-buttons {
display: flex; display: flex;
gap: 8px; gap: var(--ha-space-2);
margin-left: auto; margin-left: auto;
} }

View File

@@ -224,7 +224,7 @@ class ZWaveJSCustomParam extends LitElement {
.custom-config-form { .custom-config-form {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 16px; gap: var(--ha-space-4);
margin-bottom: 8px; margin-bottom: 8px;
} }

View File

@@ -141,7 +141,7 @@ class DownloadLogsDialog extends LitElement {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
} }
`, `,
]; ];

View File

@@ -1,8 +1,9 @@
import { import {
mdiCheck, mdiCheck,
mdiCheckCircleOutline, mdiCheckCircleOutline,
mdiDelete,
mdiDotsVertical, mdiDotsVertical,
mdiOpenInNew, mdiPencil,
mdiPlus, mdiPlus,
} from "@mdi/js"; } from "@mdi/js";
import type { PropertyValues } from "lit"; import type { PropertyValues } from "lit";
@@ -20,10 +21,11 @@ import type {
RowClickedEvent, RowClickedEvent,
SortingChangedEvent, SortingChangedEvent,
} from "../../../../components/data-table/ha-data-table"; } from "../../../../components/data-table/ha-data-table";
import "../../../../components/ha-button";
import "../../../../components/ha-fab"; import "../../../../components/ha-fab";
import "../../../../components/ha-icon"; import "../../../../components/ha-icon";
import "../../../../components/ha-button";
import "../../../../components/ha-icon-button"; import "../../../../components/ha-icon-button";
import "../../../../components/ha-icon-overflow-menu";
import "../../../../components/ha-md-button-menu"; import "../../../../components/ha-md-button-menu";
import "../../../../components/ha-md-list-item"; import "../../../../components/ha-md-list-item";
import "../../../../components/ha-svg-icon"; import "../../../../components/ha-svg-icon";
@@ -224,34 +226,40 @@ export class HaConfigLovelaceDashboards extends LitElement {
: html``, : html``,
}; };
columns.url_path = { columns.actions = {
title: "", title: "",
label: localize( label: this.hass.localize("ui.panel.config.generic.headers.actions"),
"ui.panel.config.lovelace.dashboards.picker.headers.url" type: "overflow-menu",
),
filterable: true,
showNarrow: true, showNarrow: true,
template: (dashboard) => moveable: false,
hideable: false,
template: (dashboard) => html`
<ha-icon-overflow-menu
.hass=${this.hass}
narrow narrow
? html` .items=${[
<ha-icon-button {
.path=${mdiOpenInNew} path: mdiPencil,
.urlPath=${dashboard.url_path} label: this.hass.localize(
@click=${this._navigate} "ui.panel.config.lovelace.dashboards.picker.edit"
.label=${this.hass.localize( ),
"ui.panel.config.lovelace.dashboards.picker.open" action: () => this._handleEdit(dashboard),
)} },
></ha-icon-button> ...(this._canDelete(dashboard.url_path)
` ? [
: html` {
<ha-button label: this.hass.localize(
href="/${dashboard.url_path}" "ui.panel.config.lovelace.dashboards.picker.delete"
size="small" ),
appearance="plain" path: mdiDelete,
>${this.hass.localize( action: () => this._handleDelete(dashboard),
"ui.panel.config.lovelace.dashboards.picker.open" warning: true,
)}</ha-button },
]
: []),
]}
> >
</ha-icon-overflow-menu>
`, `,
}; };
@@ -259,15 +267,15 @@ export class HaConfigLovelaceDashboards extends LitElement {
} }
); );
private _getItems = memoize((dashboards: LovelaceDashboard[]) => { private _getItems = memoize(
(dashboards: LovelaceDashboard[], defaultUrlPath: string) => {
const defaultMode = ( const defaultMode = (
this.hass.panels?.lovelace?.config as LovelacePanelConfig this.hass.panels?.lovelace?.config as LovelacePanelConfig
).mode; ).mode;
const defaultUrlPath = this.hass.defaultPanel;
const isDefault = defaultUrlPath === "lovelace"; const isDefault = defaultUrlPath === "lovelace";
const result: DataTableItem[] = [ const result: DataTableItem[] = [
{ {
icon: "hass:view-dashboard", icon: "mdi:view-dashboard",
title: this.hass.localize("panel.states"), title: this.hass.localize("panel.states"),
default: isDefault, default: isDefault,
show_in_sidebar: isDefault, show_in_sidebar: isDefault,
@@ -280,7 +288,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
]; ];
if (isComponentLoaded(this.hass, "energy")) { if (isComponentLoaded(this.hass, "energy")) {
result.push({ result.push({
icon: "hass:lightning-bolt", icon: "mdi:lightning-bolt",
title: this.hass.localize(`ui.panel.config.dashboard.energy.main`), title: this.hass.localize(`ui.panel.config.dashboard.energy.main`),
show_in_sidebar: true, show_in_sidebar: true,
mode: "storage", mode: "storage",
@@ -304,7 +312,8 @@ export class HaConfigLovelaceDashboards extends LitElement {
})) }))
); );
return result; return result;
}); }
);
protected render() { protected render() {
if (!this.hass || this._dashboards === undefined) { if (!this.hass || this._dashboards === undefined) {
@@ -324,7 +333,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
this._dashboards, this._dashboards,
this.hass.localize this.hass.localize
)} )}
.data=${this._getItems(this._dashboards)} .data=${this._getItems(this._dashboards, this.hass.defaultPanel)}
.initialSorting=${this._activeSorting} .initialSorting=${this._activeSorting}
.columnOrder=${this._activeColumnOrder} .columnOrder=${this._activeColumnOrder}
.hiddenColumns=${this._activeHiddenColumns} .hiddenColumns=${this._activeHiddenColumns}
@@ -332,7 +341,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
@sorting-changed=${this._handleSortingChanged} @sorting-changed=${this._handleSortingChanged}
.filter=${this._filter} .filter=${this._filter}
@search-changed=${this._handleSearchChange} @search-changed=${this._handleSearchChange}
@row-click=${this._editDashboard} @row-click=${this._handleRowClicked}
id="url_path" id="url_path"
has-fab has-fab
clickable clickable
@@ -370,13 +379,14 @@ export class HaConfigLovelaceDashboards extends LitElement {
this._dashboards = await fetchDashboards(this.hass); this._dashboards = await fetchDashboards(this.hass);
} }
private _navigate(ev: Event) { private _handleRowClicked(ev: CustomEvent) {
ev.stopPropagation(); ev.stopPropagation();
navigate(`/${(ev.target as any).urlPath}`); const urlPath = (ev.detail as RowClickedEvent).id;
navigate(`/${urlPath}`);
} }
private _editDashboard(ev: CustomEvent) { private _handleEdit(item: DataTableItem) {
const urlPath = (ev.detail as RowClickedEvent).id; const urlPath = item.url_path;
if (urlPath === "energy") { if (urlPath === "energy") {
navigate("/config/energy"); navigate("/config/energy");
@@ -386,6 +396,23 @@ export class HaConfigLovelaceDashboards extends LitElement {
this._openDetailDialog(dashboard, urlPath); this._openDetailDialog(dashboard, urlPath);
} }
private _canDelete(urlPath: string) {
if (urlPath === "lovelace" || urlPath === "energy") {
return false;
}
return true;
}
private _handleDelete = async (item: DataTableItem) => {
const dashboard = this._dashboards.find(
(res) => res.url_path === item.url_path
);
if (!dashboard) {
return;
}
this._deleteDashboard(dashboard);
};
private async _addDashboard() { private async _addDashboard() {
showNewDashboardDialog(this, { showNewDashboardDialog(this, {
selectConfig: async (config) => { selectConfig: async (config) => {
@@ -445,10 +472,25 @@ export class HaConfigLovelaceDashboards extends LitElement {
); );
}, },
removeDashboard: async () => { removeDashboard: async () => {
if (!dashboard) {
return false;
}
return this._deleteDashboard(dashboard);
},
});
}
private async _deleteDashboard(
dashboard: LovelaceDashboard
): Promise<boolean> {
if (!this._canDelete(dashboard.url_path)) {
return false;
}
const confirm = await showConfirmationDialog(this, { const confirm = await showConfirmationDialog(this, {
title: this.hass!.localize( title: this.hass!.localize(
"ui.panel.config.lovelace.dashboards.confirm_delete_title", "ui.panel.config.lovelace.dashboards.confirm_delete_title",
{ dashboard_title: dashboard!.title } { dashboard_title: dashboard.title }
), ),
text: this.hass!.localize( text: this.hass!.localize(
"ui.panel.config.lovelace.dashboards.confirm_delete_text" "ui.panel.config.lovelace.dashboards.confirm_delete_text"
@@ -460,16 +502,12 @@ export class HaConfigLovelaceDashboards extends LitElement {
return false; return false;
} }
try { try {
await deleteDashboard(this.hass!, dashboard!.id); await deleteDashboard(this.hass!, dashboard.id);
this._dashboards = this._dashboards!.filter( this._dashboards = this._dashboards.filter((res) => res !== dashboard);
(res) => res !== dashboard
);
return true; return true;
} catch (_err: any) { } catch (_err: any) {
return false; return false;
} }
},
});
} }
private _handleSortingChanged(ev: CustomEvent) { private _handleSortingChanged(ev: CustomEvent) {

View File

@@ -444,7 +444,7 @@ class ConfigUrlForm extends SubscribeMixin(LitElement) {
.url-container { .url-container {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: var(--ha-space-2);
margin-top: 8px; margin-top: 8px;
} }
.textfield-container { .textfield-container {

Some files were not shown because too many files have changed in this diff Show More